I guess everyone knows what patterns are today.But the question is "Are we using it when building systems?". Most of the time the answer is "No". It's very rare to find patterns from many codes i have seen in my work. Most of the times it's really hard to find patterns other than singleton.Sometimes it is possible to see some names with suffixes such as Factory,Adapter but they are never related to the behavior of factory or adapter. It's lacerating to find people with pattern expertise in any level with in the team.Why we don't use the patterns at all? Are we suffering with PatternPhobia? Why we are still reluctant to learn and use patterns? I can see wally of dilbert smiling at me and telling "Chasing Knowledge is a Fool's game asok".
Ok, In order to cure our Pattern phobia,it's good to know that what patterns can do for us.
- The first best thing is, Patterns improves your design vocabulary.It's good to communicate the structure and collaborations of your objects with the help of patterns.
- Patterns helps you to validate your design decisions.By the words of Erich gamma "Everything has a price in engineering.That's what i called Trade-offs". Patterns provide you the trade-offs when you use them without having to reinvent them.
- Patterns helps you to design at higher level of abstraction so that it improves flexibility and reuse.
- Patterns generate architectures . JUnit is yelling this at you whenever you use it.
- Patterns lessen the entropy of your code - You have less challenges when you use patterns to predict the behavior of your code rather than using a hideous code.
- Patterns can save lots of money. Patterns save lots of time when you use them and i hope you know time is money.
- And Patterns enhances your design leadership.
Personally i am a pattern fanatic.Until this moment i have an ardent desire to learn new patterns,and to refine my existing pattern knowledge.Patterns helped me a lot to solve much more complex problems with ease.It gives you some "Aha" moments when you create something worthy.From now on, i guess your pattern phobia is reduced a little bit and i encourage and request everyone to use patterns when building systems.
But remember, Patterns are not silver bullet.Don't try to solve every problem with the use of patterns.If you have more usage of patterns, it means that you have more problems.

Nice blog.... It encourage learning of patterns.... Thats great... what is the limit of learning patterns?... Answer is we should able to create new patterns.
ReplyDeleteI am right?
"Learn to create" is our motto....