I just came across two patterns.
Strategy Pattern
Decorator
Strategy Pattern :-
Strategy pattern
Strategy_pattern
Use Strategy pattern when you have to change algorithm dynamically at run time.
Decorator
Decorator pattern dynamically changes the functionality of an object at runtime without impacting the existing functionality of the objects.
When to use:
Drawbacks:
Key difference:
Strategy lets you change the guts of an object. Decorator lets you change the skin.
Few more useful posts:
When to Use the Decorator Pattern?
Real World Example of the Strategy Pattern
strategy by sourcemaking