Daily Term: Strategy Pattern
Strategy Pattern
The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable at runtime. For example, a payment system might use different strategies for processing payments (e.g., CreditCardStrategy, PayPalStrategy), selected based on user choice. The strategy pattern promotes flexibility and reusability, allowing behavior to change without modifying the client, but it can increase the number of classes and requires careful management.
Date: 2025-11-20