Home > Articles > Software Development & Management

Design Patterns 15 Years Later: An Interview with Erich Gamma, Richard Helm, and Ralph Johnson

Erich Gamma, Richard Helm, and Ralph Johnson talk to Larry O'Brien about Design Patterns, 15 years later.
Like this article? We recommend

Larry O'Brien: 85,000 apps for the iPhone have been developed and deployed in the past year-and-change. One can write a globally-accessible "Hello, World! The time is X" Web page in just one line of PHP, for instance. "Designing object-oriented software is hard," are the first words of Design Patterns. Are those words still accurate?

Richard Helm: Software design is always hard. Although most modern development environments do lots to reduce complexity through reusable libraries and toolkits (Eclipse, Apple, Microsoft), designing a software solution to the business problem is still hard.

Erich Gamma: Yes, and it is funny that you mention the iPhone. The iPhone SDK is based on the NeXTStep object-oriented frameworks like the AppKit. It already existed when we wrote Design Patterns 15 years ago and was one source of inspiration. We actually refer to this framework in several of our patterns: Adapter, Bridge, Proxy, and Chain of Responsibility.

Richard: Which is a great example of the enduring nature of good design, and how it survives different technical manifestations.

Ralph Johnson: Writing one-line programs is not usually what we mean by design. Software has improved a lot over the years, and a lot of systems that used to require careful design can now be built by reusing other software. But there are a lot of systems that we can't build that way, and writing 100K lines of new code isn't that much easier now than it was 15 years ago. It will do a lot more, but costs the same.

Designing software is hard. That is what makes it so fun! People who are good at designing software enjoy solving hard problems, at bringing order to chaos, at overcoming difficulties. Things that used to be hard are now easy, but we have moved on to working on problems that would have been impossible 20 years ago. OO programming helps but does not eliminate the difficulty of design.

Larry: The next phrase in the book is "...designing reusable object-oriented software is even harder." Reuse was, in the early 90s, presented as object-orientation's main benefit. But in the past decade, it seems that many mainstream developers have decided to leave reuse to the framework designers. Develop what you need today, do the minimal refactoring if you need to evolve it, and, if questioned, play the "You Ain't Gonna Need It," card. Is striving for reusable design an important goal for today's developers?

Richard: I think there has been an evolution in level of sophistication. Reusable software has migrated to the underlying system/language as toolkits or frameworks—and mostly should be left to the experts.

The goal for most software developers still remains to design for change—and there the debate is do you do it early (given foreknowledge) or later (once more is known and you know you need it)? In many cases the design should be refactored, and the patterns provide a target to do this.

Erich: Actually, I'd now add an additional phrase "... the hardest is evolving reusable object-oriented software." We touch on this a little bit in Design Patterns. For example, factories, adapters and facades can help when it comes to changing and evolving a reusable library. There are some additional patterns for this problem that would be worthwhile capturing.

I agree that designing durable APIs requires an additional level of sophistication. Decisions you make today will impact what you can do tomorrow. However, even experts have a hard time to get it right the first time. For example, if you dive into the Eclipse APIs you will find three different versions of the API to store preferences.

Ralph: Most programmers are not hired to write reusable software, except in the sense that the software needs to be usable years later, when requirements change and the world is a different place. On the other hand, they need to know how reusable software works, and our patterns are common in reusable software, so they are still useful for the average programmer to know. Perhaps it would be better now to aim the book at people using patterns chosen by others rather than aim it at people trying to figure out which pattern to use.

Erich: I like this idea. When I learned the iPhone SDK as I mentioned above, I noticed that I felt quickly familiar with the library, since I knew the used patterns.

Larry: For a while, everything became a "pattern." There were patterns for architecture, organizational behavior, analysis, etc. What was less apparent, though, was an evolution where the 23 patterns in the DP catalog were extended by X other design patterns or related to, say, architectural patterns. There are a lot of patterns out there. Is there a new "Figure 1.1: Design pattern relationships"?

Figure 1.1: Design pattern relationships

Ralph: If you mean "Do we have a figure to give you?" the answer is "No." If you mean "Should someone create a new figure?" the answer is "Yes."

Erich: There is the Patterns Almanac 2000 from Linda Rising that attempted to capture many patterns. It was a significant amount of work, but didn't get as much traction in the community. I start to think that social filtering would help to find out the most popular patterns and get hints like "people that found this pattern useful have also liked this one...". In other words, not all patterns have the same relevance and weight. We were pretty lucky that we picked a good sample of patterns in DP.

Larry: The description template used in DP had a lot of features beyond Name, Intent, and Structure. Not everyone who jumped on the patterns bandwagon provided all those elements. If you were to refactor that template today, what would you do to it?

Ralph: The template was okay for low-level object-oriented patterns like the ones in our book. It was not good for other purposes. People quickly found that out and chose different templates. Every collection of patterns needs a standard template, but I don't think any template will ever be good for all patterns. So, I find arguments about templates boring.

Erich: I'm not attached to a particular template. I'm glad that we eventually agreed on one and then stuck to it. It helped us to achieve consistency and forced a level of completeness, e.g., do we have known uses, do we describe the consequences.

Larry: After the pattern bandwagon, there was a trend towards "anti-patterns." Are anti-patterns as valuable as patterns?

Richard: Probably—they provide a way to share and learn from mistakes

Ralph: I prefer the notion of "code smells," or "design smells"/"architecture smells" etc. They aren't always mistakes. Sometimes they are just problems you have to live with. For example, "stove pipe" systems grew up partly because companies didn't have good ways of interconnecting their systems, partly because technology was changing rapidly, and partly because the different parts of a company didn't cooperate. In a mature, slowly growing company, stove pipe systems are an architecture smell that should probably be eliminated using SOA and a strong architecture team. But in a company that is growing rapidly by buying other companies, stove pipes are due to the fact that it takes time to integrate a new company. No amount of architectural leadership will eliminate the problem.

Some of my students wrote a pattern for "Big Ball of Mud." For most people who read patterns, this is an anti-pattern to be avoided at all costs. But to a lot of IT organizations, especially ones I've seen in government, there just isn't enough expertise to do better. Anything they build will, in a few years, lose its structure and become connected with everything else.

Erich: Using a code smell or anti-pattern to motivate the use of a design pattern is valuable. It is difficult to appreciate the value of a design pattern without seeing the code before and after the use of a design pattern.

Larry: GoF came out relatively early in the ascent of OOP as the mainstream paradigm and, for better or worse, "patterns" seem to be associated with OO approaches. You even hear functional and dynamic advocates boasting that their languages "don't need" patterns. How do you respond to that?

Erich: Just as an aside, it is also easy to forget that we wrote design patterns before there was Java or C#.

Ralph: Some of those languages don't need some of the patterns in Design Patterns because their languages provide alternative ways of solving the problems. Our patterns are for languages between C++ and Smalltalk, which includes just about everything called "object-oriented," but they certainly are not for every programming language. I don't think anybody actually says that programmers in other languages don't need patterns; they just have a different set of patterns.

Erich: Design patterns eventually emerge for any language. Design déjà-vu is language neutral. While these experiences are not always captured as patterns, they do exist. The design principles for Erlang come to mind.

Larry: Where would a person go to learn about patterns for dynamic and functional languages? Who's making good contributions?

Ralph: If by "dynamic" you mean dynamic object-oriented languages like Smalltalk, Ruby or Python, then our patterns are applicable. Functional languages require different patterns, but I don't know who is working on them.

Larry: OOP provides a combination of static and dynamic structure, allowing the design intent to be communicated along a few different axes (or at least with different diagrams). With today's emphasis on functional and meta-programming approaches, there's not as much static structure. Instead, there's a lot of talk about communicating design intent by creating APIs in the context of a "domain-specific language" or a "fluid interface." Do these approaches replace or complement the patterns in DP?

Richard: Complement. Rich class libraries structured well using good design take on features/characteristics of domain-specific languages. Reading code for a well designed user-interface toolkit becomes like reading a domain-specific language for GUIs. The library constructs become the verbs and nouns of the domain-specific language. For example, if you go back and look at the code in Interviews/Unidraw (co-written by John Vlissides), although the language was C++, the code could easily be understood by someone who knew how to build GUIs.

Erich: While they complement the patterns in DP it can indeed be the case that meta-programming can replace the design pattern used in a design. The evolution of JUnit 3 to JUnit 4 comes to mind. JUnit 3 was a small framework that used several patterns like Composite, Template Method and Command. JUnit 4 leverages the Annotations meta-programming facilities introduced in J2SE 5.0. The use of the patterns disappeared and the framework evolved into a small set of annotations plus a test runner infrastructure that executes the annotated Java code.

Larry: Generative patterns: There are 253 patterns in A Pattern Language and 23 in DP. Do you think the DP catalog fulfills Alexander's edict that "[A pattern language] not only tells us the rules of arrangement, but shows us how to construct arrangements—as many as we want—which satisfy the rules"?

Richard: No. It was not the intent to be a prescriptive or generative guide. The inspiration for me came more from engineering handbooks where an engineer/designer would reach up to his bookshelf and find a generic mechanical design for clutches or two stroke engines.

Larry: How would you refactor "Design Patterns"?

Erich: We did this exercise in 2005. Here are some notes from our session. We have found that the object-oriented design principles and most of the patterns haven't changed since then. We wanted to change the categorization, add some new members and also drop some of the patterns. Most of the discussion was about changing the categorization and in particular which patterns to drop.

When discussing which patterns to drop, we found that we still love them all. (Not really—I'm in favor of dropping Singleton. Its use is almost always a design smell.)

So here are some of the changes:

  • Interpreter and Flyweight should be moved into a separate category that we referred to as "Other/Compound" since they really are different beasts than the other patterns. Factory Method would be generalized to Factory.
  • The categories are: Core, Creational, Peripheral and Other. The intent here is to emphasize the important patterns and to separate them from the less frequently used ones.
  • The new members are: Null Object, Type Object, Dependency Injection, and Extension Object/Interface (see "Extension Object" in Pattern Languages of Program Design 3, Addison- Wesley, 1997).
  • These were the categories:
    • Core: Composite, Strategy, State, Command, Iterator, Proxy, Template Method, Facade
    • Creational: Factory, Prototype, Builder, Dependency Injection
    • Peripheral: Abstract Factory, Visitor, Decorator, Mediator, Type Object, Null Object, Extension Object
    • Other: Flyweight, Interpreter

As I said above these are just notes in a draft state. Doing a refactoring without test cases is always dangerous...

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020