Which design pattern is used to define a family of algorithms, encapsulate each algorithm, and make them interchangeable?

  • Command
  • Decorator
  • Observer
  • Strategy
The Strategy design pattern is used to define a family of algorithms, encapsulate each algorithm, and make them interchangeable. It allows the client to choose the appropriate algorithm at runtime.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *