The Strategy pattern defines a family of algorithms, encapsulates each one and makes them interchangeable. The structure of the Strategy pattern. Clients configure the Context with one of the ConcreteStrategy objects, thereafter, clients interact with the context exclusively. The ConcreteStrategy object can be changed at run time.
Strategy pattern offers an alternative to subclassing and eliminates conditional statements.
On the other side, it introduces communication overheads between Strategy and Context and increases the number of objects in the system. The Strategy pattern presented in this template library is a slight variation of the Strategy pattern as per Gamma et al. Therefore the present implementation considers the pull model in implementing the AlgorithmInterface function, in which Context passes itself as an argument, and Strategy requests data from Context explicitly. In this case Strategy can request exactly what it needs. However, now Context must define a more elaborate interface to its data, which couples Strategy and Context more closely.