Sunday, December 12, 2010

Design Patterns - An eye for similarities - Part 1

Almost in every software that we built there are a lot of algorithms and rules that tend to beat around the same bush. Obviously a lot of people before us have found that out and have wondered on how some generic solutions could built for them so as to make life a bit simpler. The result of this was Design Patterns. In this multi-part series we'd be look at them patterns, how they help in finding bottlenecks and how to get around them.

So how do we find on where to use patterns?

This for most people is the toughest part. And true sometimes it is really confusing. But with careful thought and proper application I think we can definitely get to a point where we recognize them with ease.
- First and the foremost read through the requirements. Very important.
- Ask questions and lots of them. The more clear you are on the requirements, the better you can visualize the system.
- Find out all the "is-a", "as-a" and "has-a" relationships. This helps you in building up the hierarchy, interfaces and abstractions.
- Have a thorough knowledge of the existing design patterns and go through loads of examples to understand the nuances with each.
- Also a familiarity with anti design patterns does not hurt either.

Hope this gives a basic idea of what to do when getting ready to design applications. :)
Happy Designing.. :)

Part 2 [Strategy and Observer Patterns]
Part 3 [ Decorator Pattern ]
Part 4 [ Factory Pattern ]

No comments :