What is the need for Strategy Pattern in C#?If your application
contains a set of algorithms wherein Client should have option to choose
the suitable algorithm and the algorithms must be interchangeable, then
you can implement strategy pattern to encapsulate such algorithms.
Here is a code sample for it: class contextClass
{ The strategyClass
can now be inherited by different classes and the context class can trigger
any of these derived classes by using the following statements:
|