Head First Design Patterns - Strategy Pattern
Design Principle:
- Identify the aspects of your application that vary and sparate them from what stays the same.
- Program to an interface, not an implementation.
- Favor composition over inheritance
The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable.
Strategy lets the algorithm vary independently from clients that use it.