Use the Strategy pattern when…

  • Many related classes differ only in their behavior.
  • There are different algorithms for a given purpose, and the selection criteria can be codified.
  • The algorithm uses data to which the client should not have access.