Reflections on Design Patterns After Two Decades

October 29, 2014 — Posted by Al Shalloway

On the 20th Anniversary of Design Patterns, the InformIT editorial team decided to ask several patterns gurus for their reflection on patterns over the last two decades.  You can see the entire article here.

Here's Jim Trott and my post - Design Patterns in an Agile World

After two decades of use, design patterns are as misunderstood as they were when they were first introduced. They are misunderstood by developers who naively force a design pattern—or what they understand a pattern to be—only a solution. They are misunderstood by agilists who think design patterns are a vestige of the Age of Big Design and should be abandoned. But like many truths in life, just because they are misunderstood by many does not mean they are not relevant. In fact, they are more important and more useful than ever and especially in an Agile world. They just need to be understood.

To understand design patterns requires understanding the thought process of patterns. Near the end of The Timeless Way of Building, the inspiration for design patterns in software, Christopher Alexander states that, “At this final stage the patterns are no longer important: the patterns have taught you to be receptive to what’s real.” In the world of software development, what is real is how you manage variation.

In their seminal work on design patterns, Ralph Johnson, John Vlissides, Richard Helm, and Erich Gamma (the “Gang of Four”), described the essence of design patterns as,

  • Design to an object’s behavior
  • Use delegation instead of inheritance to contain new behavior
  • Find what varies, encapsulate it behind an abstraction (e.g., Interface) and delegate to it without the client object knowing which type of object it has

This advice still stands the test of time. In a nutshell, it means to hide variation so that client objects don’t have to change when a new behavior is required.

Prior to the widespread adoption of Agile, this was usually applied to variations that were present in the initial design. But as Agile came more and more to the forefront, its meaning has come to include variation over time. In other words, design patterns can be useful in hiding the variation of our understanding of a requirement over time, even if only one implementation is present at any one moment.

Design patterns therefore become one of the cornerstones of emergent design along with refactoring and test-driven development. By following the mantra of delegating to an abstraction that hides variation as it becomes necessary, designs can evolve while code quality stays high. Design patterns provide insights into the solutions that are evolving and they guide the refactorings required to achieve these solutions.  Design patterns become a thought process instead of a set of solutions.

A terrific resource that shows design patterns—and refactoring and TDD—in the context of emergent design is Essential Skills for the Agile Developer: A Guide to Better Programming and Design by Shalloway, Bain, Pugh, and Kolsky. For example, they identify and describe the following essential practices that spring directly from design patterns:

  • Design to interfaces
    • Programming by intention
    • Define tests up front
    • Interface oriented design
    • Acceptance Test-Driven Development
  • Prefer delegation and encapsulate what varies
    • Separate use from construction
    • Encapsulate that
    • Commonality and Variability Analysis

Refactor to the Open-Closed Design patterns are still relevant today but the books that introduced them 20 years ago need to be updated. For example, the iconic book by Gang of Four, Design Patterns: Elements of Reusable Object-Oriented Software, is showing its age. It provides examples using languages such as SmallTalk and C++ which are not as widely used today. And it shows solution illustrations that use structures that were more idiomatic 20 years ago and not necessarily best solutions today, such as using linked lists instead of collections. But even if some of the details need to be updated, the essential thought processes are still solid. It is the wise developer who will listen and do the mapping to today’s contexts. And incorporate the thinking processes of design patterns into their practice.

Al Shalloway
CEO, Net Objectives

 

Subscribe to our blog Net Objectives Thoughts Blog

Share this:

About the author | Al Shalloway

Al Shalloway is the founder and CEO of Net Objectives. With over 40 years of experience, Alan is an industry thought leader in Lean, Kanban, product portfolio management, SAFe, Scrum and agile design.



        

Blog Authors

Al Shalloway
Business, Operations, Process, Sales, Agile Design and Patterns, Personal Development, Agile, Lean, SAFe, Kanban, Kanban Method, Scrum, Scrumban, XP
Cory Foy
Change Management, Innovation Games, Team Agility, Transitioning to Agile
Guy Beaver
Business and Strategy Development, Executive Management, Management, Operations, DevOps, Planning/Estimation, Change Management, Lean Implementation, Transitioning to Agile, Lean-Agile, Lean, SAFe, Kanban, Scrum
Israel Gat
Business and Strategy Development, DevOps, Lean Implementation, Agile, Lean, Kanban, Scrum
Jim Trott
Business and Strategy Development, Analysis and Design Methods, Change Management, Knowledge Management, Lean Implementation, Team Agility, Transitioning to Agile, Workflow, Technical Writing, Certifications, Coaching, Mentoring, Online Training, Professional Development, Agile, Lean-Agile, SAFe, Kanban
Ken Pugh
Agile Design and Patterns, Software Design, Design Patterns, C++, C#, Java, Technical Writing, TDD, ATDD, Certifications, Coaching, Mentoring, Professional Development, Agile, Lean-Agile, Lean, SAFe, Kanban, Kanban Method, Scrum, Scrumban, XP
Marc Danziger
Business and Strategy Development, Change Management, Team Agility, Online Communities, Promotional Initiatives, Sales and Marketing Collateral
Max Guernsey
Analysis and Design Methods, Planning/Estimation, Database Agility, Design Patterns, TDD, TDD Databases, ATDD, Lean-Agile, Scrum
Scott Bain
Analysis and Design Methods, Agile Design and Patterns, Software Design, Design Patterns, Technical Writing, TDD, Coaching, Mentoring, Online Training, Professional Development, Agile
Steve Thomas
Business and Strategy Development, Change Management, Lean Implementation, Team Agility, Transitioning to Agile
Tom Grant
Business and Strategy Development, Executive Management, Management, DevOps, Analyst, Analysis and Design Methods, Planning/Estimation, Innovation Games, Lean Implementation, Agile, Lean-Agile, Lean, Kanban