Strategy Pattern defines a family of algorithms, encapsulates each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
-
Identify the aspects of your application that vary and separate them from what stays the same
-
Program to an interface, not an implementation.
-
Favor composition over inheritance.