This post wont be longer like the previous one in this series. Also this would be the last one under this series.
I am writing this post just to summarize what we learn so far in this series blog posts. It’s important to note that, not only learning a pattern is important or a big deal it’s also important to know when to choose what. Its like saying, a good warrior also knows to choose the best weapon in required scenarios. He for sure wont use wrong weapons or use the same everywhere.
When to choose What:
- There is an existing component or module which can not be changed but its interface is incompatible with the others.
- So only one component varies but other remains nearly constants or unchanged.
When you want to enhance the responsibilities of an object.
When extension for an object via sub-classing is complex/tedious or even costly.
- Applied if all the classes or components are designed.
- When implementation of components on both sides vary independently but has same constant interface designed earlier.
When you want to define new interface for a group of objects with out adding new functionality.
When you want to represent 1 object for a group of objects to simplify communication.
Well dear friend, i hope you have understood the Structural patterns as i did couple of months back. If these long posts helps you in undestanding better, then i am glad and my hard work payed off 🙂
Thanks for reading.
P.S: Please leave your valuable comments for my learning.