Strategy Pattern
The Strategy Pattern is a design pattern used in software development that enables selecting an algorithm's behavior at runtime. It defines a family of algorithms, encapsulates each one, and makes them interchangeable. This allows clients to choose which algorithm to use without altering the code that uses it.
In this pattern, a context class maintains a reference to a strategy interface, allowing it to delegate the algorithm's execution to the selected strategy. This promotes flexibility and reusability, as new strategies can be added without modifying existing code, adhering to the Open/Closed Principle in software design.