| Strategy Pattern |
Article Index for Strategy |
Website Links For Strategy |
Information AboutStrategy Pattern |
| CATEGORIES ABOUT STRATEGY PATTERN | |
| software design patterns | |
| articles with example c sharp code | |
| articles with example java code | |
|
The strategy pattern is useful for situations where it is necessary to dynamically swap the algorithms used in an application. The strategy pattern is intended to provide a means to define a family of algorithms, encapsulate each one as an object, and make them interchangeable. The strategy pattern lets the algorithms vary independently from clients that use them. EXAMPLE Sample Code in C#; Strategy - Interface: The classes that implement a concrete strategy should implement it. The context class uses this to call the concrete strategy. ConcreteStrategy: Implements the algorithm using the strategy interface. Context: configured with a ConcreteStrategy object and maintains a reference to a Strategy object
SEE ALSO EXTERNAL LINKS |
|
|