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.
Loading...
Related Quiz
- In which situations is the Factory Method design pattern useful?
-
What does the HTML element represent?
- What is the purpose of a database lock in concurrency control?
- What status code is returned by a RESTful API to indicate a successful request?
- You're working on a project with multiple team members. Two developers have made conflicting changes to the same function in different branches. How would you approach resolving this merge conflict?