Artima Developer的總編 Bill Venners在對Erich Gamma的一次采訪中,
仔細討論了Design Pattern(設計模式)的問題。當我們做設計的時候,我們首先會想到使用設計模式。那么如何使用設計模式?如何用設計模式進行思考?是否當你解決一個問題的時候,必須要使用設計模式?
Bill Venners將把這次訪談的內容分多次,發表在Artima Developer上。Erich Gamma的論述確實精彩,他不僅談到了當初如何進入Design Pattern這個領域的過程,也談到了在他開發JUnit的過程中,如何設計JUnit,以及如何在JUnit中使用Design Pattern。
“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. Patterns go beyond applying objects to some graphical shape example, with a shape class hierarchy and some polymorphic draw method. You really learn about polymorphism when you've understood the patterns. So patterns are good for learning OO and design in general.”
“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. ”
“Do not start immediately throwing patterns into a design, but use them as you go and understand more of the problem. Because of this I really like to use patterns after the fact, refactoring to patterns. ….. Trying to use all the patterns is a bad thing, because you will end up with synthetic designs—speculative designs that have flexibility that no one needs. These days software is too complex. We can't afford to speculate what else it should do. We need to really focus on what it needs. ”
“We didn't just string patterns together when we designed JUnit. We did it test-driven, starting with a test that we wanted to succeed and once it passed we looked into how we could improve the code. ”
Who is Erich Gamma?(這個問題好像問的有些傻)

《Design Patterns: Elements of Reusable Object-Oriented Software》,《Contributing to Eclipse: Principles, Patterns, and Plug-Ins》的作者之一;JUnit的作者之一;Eclipse JDT的負責人。他目前在IBM的瑞士蘇黎世OTI實驗室工作。
[Update]感謝的lxwde中文翻譯。

第一次訪談的詳細內容。
Artima Developer
CSDN 上的中文翻譯
Email this store to a friend (send a short email with a subject to this story)
Subscribe to kukooBlog (subscribe kukooBlog's RSS feed)
Send me feedback on this story
Design Pattern
Programming