ifacethoughts

Design Patterns As A Guide, Not A Toolkit

There is a certain hatred for design patterns in a certain class of programmers. I am inno position to judge these reactions. However, I myself have gone through a cycle, where I worshipped them, then realized that they too had pitfalls, got confused, and now I realize that perhaps I completely misunderstood them.

Quoting from the book:

The pattern name is a handle we can use to describe a design problem, its solutions and consequences in a word or two.

Christopher Alexander’s quote about patterns, in context of designing buildings and towns, is:

Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.

I think the biggest fattest boldest keyword that should be talked about here is the problem, not the solution. Every good programmer knows that there cannot be a one-size-fits-all solution. In software, generic solutions do not work, because every problem is unique in nature. However, some problems have overlapping attributes. I think that the patterns represent these common attributes more than the solutions to them.

I agree to an extent that reading about design patterns can make a programmer careless and feel that he has a toolkit in hand to do all kinds of house jobs. The biggest disadvantage I have witnessed is that people want to use patterns and hence assume existence of the problems, without really analyzing them. The patterns are helpful to you if you do not use them as a toolkit, but more as a guide. Keeping them in mind can help you get the problem quicker and guide you into building your own solution.

Also, I think that over years every developer creates his/her own patterns. They build on the foundation of beliefs, principles and understanding of concepts. The design pattern critics argue that the GoF book works against this and imposes its own patterns. However, instead of completely dismissing them, I have experienced that they can be highly valuable in the role of a guide.

Discussion [Participate or Link]

  1. zjffdu said:

    I think for novice, design pattern will be toolkit, while for professionals it can be a guide.

Say your thought!

If you want to use HTML you can use these tags: <a>, <em>, <strong>, <abbr>, <code>, <blockquote>. Closing the tags will be appreciated as this site uses valid XHTML.

freshthoughts

contactme

Abhijit Nadgouda
iface Consulting
India
+91 9819820312
My bookmarks

badgesand...

This is the weblog of Abhijit Nadgouda where he writes down his thoughts on software development and related topics. You are invited to subscribe to the feed to stay updated or check out more subscription options. Or you can choose to browse by one of the topics.