Strategy Pattern

1. Usage Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from the clients that use it. Capture the abstraction in an interface, bury implementation details in derived classes. 2. UML class diagram 3. Pros greater flexibility, reuse can change algorithms dynamically 4. Cons strategy creation […]