Design patterns

data management
Cognitive bias
%alireza rashidi data science%
Statistical lies
The History of Design Patterns — From Buildings to Software
Software Design Series

Design patterns. A history of ideas.

From buildings to software—and the decisions you still have to make.

You add a chart beside a table in a sales dashboard. When the data changes, both views must update. You could hard-code two calls. But what happens when you add another view, close one, or move it into a separate service? The history of design patterns helps you recognize what changes at each step.

A useful pattern gives you a name for a recurring problem, the reasoning behind a solution, and the costs you accept.

01— Origins

Before classes, there were buildings.#

The software patterns movement borrowed an architectural idea: document recurring design problems in their context, then describe adaptable solutions. It did not begin as a checklist of class diagrams.

A Pattern Language appeared in 1977. Alexander and his collaborators collected 253 patterns spanning towns, buildings, and construction, with the aim of helping people shape their own environments.[1] The Timeless Way of Building followed in 1979 and developed the underlying theory.[2]

A pattern connects a recurring problem with a solution that makes sense under particular constraints. A pattern language adds relationships: one design decision creates the context for others.[3]

For our dashboard, start with the user’s task: compare the same sales data in a table and a chart. The important tension is shared information with independently changing views. That is a problem description you can carry between implementations.

Kent Beck and Ward Cunningham’s 1987 paper, Using Pattern Languages for Object-Oriented Programs, documented an early adaptation. Its five window-interface patterns included Window Per Task and Few Panes Per Window. Their order guided decisions from the overall task down to panes and actions.[3]

Viewed through that lens, your dashboard’s table and chart belong together because they support one task. You decide how the person uses the window before deciding how its objects communicate.

Four milestones behind the dashboard’s design
From pattern languages to messaging patterns Four dated milestones provide lenses for the dashboard example: describing context, designing its interface, coordinating objects, and connecting systems. 1977 A Pattern Language Describe the context 1987 Beck & Cunningham Design the interface 1994 Gang of Four Coordinate objects 2003 Integration patterns Connect systems Calendar years · distances are proportional · selected milestones

How to read this: The gaps represent elapsed years. Each subtitle applies that period’s ideas to our hypothetical dashboard; it does not claim the dashboard existed then. These are selected milestones, not the invention dates of every underlying technique.[1][3][4][8]

02— The Gang of Four

Give the collaboration a name.#

Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides catalogued 23 recurring object-oriented designs in Design Patterns. Published in 1994 with a 1995 copyright, the book explains applicability and consequences alongside examples in C++ and Smalltalk.[4]

253patterns in A Pattern Language[1]
23patterns in the GoF catalog[4]
3GoF categories[4]

Your table and chart can register with the data model, receive updates, and unregister when no longer needed. The model can work through a common update contract instead of knowing each view’s rendering details. Norvig later used a closely related spreadsheet-and-bar-chart example to explain Observer.[9]

Creational

How objects are created. A dashboard might need interchangeable view construction.

Structural

How objects fit together. An adapter might reconcile a legacy data interface.

Behavioral

How objects collaborate. Observer coordinates the dashboard’s updates.

One data change, two subscribed views
Observer inside the sales dashboard The table and chart register with a data model, then each receives an update after the model changes; this is a local synchronous example. Data model Table view Chart view subscribe() subscribe() New sales snapshot update(data) update(data) Time flows down · solid arrows are calls · dashed lines are lifelines

How to read this: Read downward: views subscribe, data changes, then the model calls each view. Thin rectangles show activity. Return arrows are omitted; spacing shows order, not duration. This local example provides no network-delivery guarantees.

For a fixed two-view screen, direct calls may be enough. Registration becomes useful when views come and go. Either way, decide what happens when a view closes or its update fails. Naming Observer helps you discuss that responsibility; it does not implement the policy.

03— Beyond the catalog

A community made the vocabulary grow.#

A catalog records a set of solutions. A community can challenge their explanations, document new contexts, and connect patterns into larger designs.

The Hillside Group grew from a 1993 gathering. The first Pattern Languages of Programs conference took place in 1994 near Monticello, Illinois.[5] In March 1995, Cunningham opened the collaborative People, Projects & Patterns area of the Portland Pattern Repository, part of the early WikiWikiWeb story.[6]

For your dashboard, a useful pattern account would explain why views subscribe, how they detach, and what failures cost. Another developer can then challenge the assumptions instead of copying an unexplained diagram.

Pattern-Oriented Software Architecture began in 1996, spanning architecture, design patterns, and implementation idioms.[12] Martin Fowler’s Patterns of Enterprise Application Architecture followed in 2002, addressing concerns such as domain logic and persistence.[7] Gregor Hohpe and Bobby Woolf’s Enterprise Integration Patterns documented 65 messaging patterns in 2003.[8]

Now move the dashboard’s chart into another service. A publish-subscribe channel offers a related one-to-many communication structure, but you must also choose delivery, retry, and failure behavior.[8] Replacing local calls with messages changes the engineering problem.

Do not mistake later popularity for invention. Garcia-Molina and Salem’s 1987 Sagas work already described splitting long transactions and using compensating transactions after partial execution.[10] The histories overlap; they are not a single ladder from GoF to microservices.

04— What survives

Keep the reasoning. Revisit the machinery.#

Language features can make a pattern’s implementation smaller. They do not automatically decide which dependencies, lifetimes, or failure modes your application should have.

In his 1996 talk, Peter Norvig argued that 16 of the 23 GoF patterns had substantially simpler implementations in Lisp or Dylan than in C++, for at least some uses. His slides described them as “invisible or simpler.” This was a qualified language comparison, not a universal obsolescence score.[9]

Here is an illustrative JavaScript notification core for our dashboard. A view supplies a function rather than an instance of an observer class. The returned function lets that view unsubscribe.

Dashboard example · Synchronous callbacks
const subscribers = new Set();

function subscribe(updateView) {
  subscribers.add(updateView);
  return () => subscribers.delete(updateView);
}

function publish(snapshot) {
  for (const updateView of [...subscribers]) {
    updateView(snapshot);
  }
}

This example chooses synchronous dispatch over a snapshot of the subscriber list. If a callback throws, later callbacks are not called. Removing a callback during dispatch does not remove it from that already-copied list. Those are concrete semantics you must accept or change.

The example is our adaptation, not Norvig’s implementation. His Observer example uses method combination. The general lesson is to examine what your language can express before reproducing an older class structure.[9]

Updating the dashboard after a notification does not imply Event Sourcing. Making an event history authoritative is a separate decision. CQRS separates read and write models and can be used without events.[11] These names should narrow the discussion, not merge distinct choices.

01 · CONTEXTName the pressure

Views change independently, while displaying the same sales state.

02 · MECHANISMChoose the smallest fit

Direct calls, registered callbacks, or a message channel—depending on the boundary.

03 · CONSEQUENCESExplain the trade-off

Specify cleanup, ordering, and what a failed update does to the other views.

Try the decision · 1 question

Does a simpler implementation erase the pattern?

Your dashboard already supports callbacks and unsubscription. Someone suggests adding a class hierarchy because the GoF diagram contains classes. What should you do?

Read the answer and why

Check the notification and lifetime contract. A callback can represent an observer’s behavior without a class hierarchy, while registration, cleanup, and failure handling still need deliberate choices. The useful question is what the extra structure would solve.

Did the Gang of Four invent design patterns?

No. Alexander’s architectural work and Beck and Cunningham’s software adaptation came earlier. The GoF book catalogued 23 object-oriented patterns and gave developers a shared reference.[1][3][4]

Was the GoF book published in 1994 or 1995?

The publisher lists a 1994 publication date and a 1995 copyright. They refer to different bibliographic fields.[4]

Are design patterns still useful?

They remain useful when they clarify a recurring problem and its trade-offs. Your dashboard may need Observer’s collaboration contract while using functions or an existing framework to implement it.

05— Sources

Read the original accounts.#

Author-maintained pages, original papers, community records, and publisher catalogs support the chronology. The sales dashboard and its JavaScript are teaching examples; the diagrams do not depict a historical product.

  1. A Pattern Language: Towns, Buildings, Construction. Christopher Alexander and collaborators, 1977.Author’s sitePublication year and the 253-pattern architectural language.
  2. The Timeless Way of Building. Christopher Alexander, 1979.Author’s site
  3. Using Pattern Languages for Object-Oriented Programs. Kent Beck and Ward Cunningham, 1987.Original paper
  4. Design Patterns: Elements of Reusable Object-Oriented Software. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides.Publisher recordPublished 1994; copyright 1995. Catalog, categories, and original preface.
  5. Hillside Group history and the first PLoP conference. Hillside Group.Group historyConference record
  6. Portland Pattern Repository: Recent Changes. Cunningham & Cunningham.Original changelogThe March 25, 1995 entry records the People, Projects & Patterns opening.
  7. Patterns of Enterprise Application Architecture. Martin Fowler, 2002.Author’s account
  8. Enterprise Integration Patterns. Gregor Hohpe and Bobby Woolf, 2003.Book detailsPublish-Subscribe Channel
  9. Design Patterns in Dynamic Languages. Peter Norvig, presented 1996; posted online 1998.Talk and slidesThe qualified 16-of-23 comparison and the Observer example.
  10. Sagas. Hector Garcia-Molina and Kenneth Salem, 1987.Princeton technical report
  11. What do you mean by “Event-Driven”? Martin Fowler, 2017.Author’s article
  12. Books on Pattern-Oriented Software Architecture. POSA series overview, Vanderbilt University.Series accountVolume 1 appeared in 1996 and spans architectural patterns, design patterns, and idioms.

Ali Reza Rashidi
Ali Reza Rashidi
Ali Reza Rashidi, a Senior Data Scientist-Gen Al | Al Architect | MLOps with over ten years of experience, He is the author of three books that delve into the world of data and management.

Leave a Reply

Your email address will not be published. Required fields are marked *