This design defines a set of algorithms, encapsulates each one, and makes them interchangeable. It enables a client to select an algorithm from a family of algorithms at runtime and provides a simple interface to access it.
Examples of strategy patterns include:
The classes, interfaces, & objects in the above UML class diagram are defined as follows:
The Strategy design pattern is applicable in the following scenarios: