[Design Patterns] The Strategy Pattern

Strategy Pattern – is when you define some interfaces which represent the strategies for various context dependent tasks.
Then you implement these interfaces in classes with alternative purposes. Sometimes during runtime, the implementations can be
switched so that a new strategy is adopted. In the actual client code (that is employing the strategies), you define the strategies as interfaces and provide strategy setters methods. The most important business logic calculations methods that depend on the context then call the strategy’s methods to perform those calculations or parts of them.


Leave a Reply

Your email address will not be published. Required fields are marked *