Pattern STRATEGY


Solution

  1. Define the strategy i/f, an abstraction for the algorithm
  2. Concrete strategy classes implement the strategy i/f; each class defines a version of the algorithm
  3. Client supplies a concrete strategy object to the context class
  4. The context class calls the appropriate functions of the strategy object

prev |top |next