Skip to content

Latest commit

 

History

History

strategy.pattern

Strategy Pattern

  • Encapsulate a family of related algorithms
  • Allow a class to maintain a single purpose
  • Switch statements are a red flag!!!

Implementation

  • Create classes for each logic(ex calculation) (strategies)
  • Use a common interface for each Strategy