strategy pattern

Strategy Pattern:

Define a family of algorithms, ecapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

OO-Principles:

1.Encapsulate what varies.

2.Favor composition over interface.

3.Program to interfaces, not implementations.

strategy pattern