Strategy pattern comes under behavioral design patterns category, this pattern defines skeleton of an algorithm in the superclass but lets subclasses override specific steps of algorithm without changing its structures. This pattern also known as policy pattern.
Strategy Pattern Characteristics.
|
|
|
|
|
|
|
|
Context |
|
IStrategy |
|
Strategy |
|
|
|
|
|
|
|
|
Strategy Pattern Advantages.
- A more extensible, object oriented and dynamic implementation.
- Easily add new strategies without affecting existing ones.
- Clean approach with single responsibility in mind.
Strategy Pattern Disadvantage.
- Make sure you don't make your applications more complex than then they have to be!
No comments:
Post a Comment