Strategy Pattern - What's not to like?
The Strategy pattern uses aggregation instead of inheritance. In the Strategy pattern behaviors are defined as separate interfaces and specific classes that implement these interfaces. Specific classes encapsulate these interfaces. This allows better decoupling between the behavior and the class that uses the behavior.
We often use small strategy objects when we need to vary behavior. ... such procedural objects usually are small and are used when we have a particular need for flexibility.
No comments:
Post a Comment