Mike Dunbar
Posts: 12
Nickname: mikedunbar
Registered: Jun, 2004
|
|
Re: How to Use Design Patterns
|
Posted: May 24, 2005 7:29 AM
|
|
Good to see another interview here, seems like it's been so long and I really miss them!
Really appreciate the questions and response around the real value of patterns, and how to use them.
Erich Gamma: I think patterns as a whole can help people learn object-oriented thinking: how you can leverage polymorphism, design for composition, delegation, balance responsibilities, and provide pluggable behavior...
Very important aspect of patterns. My personal observation is that OO is still, by and large, poorly understood and implemented. So many projects lack basic ingredients like abstraction and separation of concerns, resulting in tangled messes that are a nightmare to maintain.
The emphasis on pragmatic use of patterns was very good to hear, especially from one of the original gang:
Erich Gamma: ..Do not start immediately throwing patterns into a design, but use them as you go and understand more of the problem....I saw in a news group someone claiming that in a particular program they tried to use all 23 GoF patterns...
This sort of pattern abuse has turned off many people from patterns altogether, which is very unfortunate. Even if a small percentage of patterns is actually needed on a given project, you still need to understand them, so you know when to use them:
Erich Gamma: ...Patterns are distilled from the experiences of experts. They enable you to repeat a successful design done by someone else. By doing so you can stand on the shoulders of the experts and do not have to re-invent the wheel...People should learn that when they have a particular kind of problem or code smell, as people call it these days, they can go to their patterns toolbox to find a solution. ... A lot of the patterns are about extensibility and reusability. When you really need extensibility, then patterns provide you with a way to achieve it and this is cool. But when you don't need it, you should keep your design simple and not add unnecessary levels of indirection. One of our Eclipse mottos is that we want extensibility where it matters.
Look forward to the remaining installments of this interview.
|
|