A Strategy Pattern belongs to the Behavioral Pattern category. It helps in de-coupling the client and the algorithms into separate classes. The object and it’s behavior are encapsulated into their own classes. This pattern helps in several ways. It helps you to switch algorithms at any time. In future, if you decide to add a new algorithm, it’s simpler as all you have to do is add a new class that encapsulates the new behavior.
|
3
shouts |
|
|||
No comments yet, be the first one to post comment.