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.
Important principles demonstrated in this pattern include:-
- Encapsulate what varies and separate it from what stays the same.
- Progam to interfaces, not implementations.
- Favor composition over inheritance.
GoBack to Design Patterns