# A Recipe with a Name

A design pattern has four parts, a name, a problem, a solution and its consequences, like a recipe card; this lesson shows where patterns came from (an architect's book, then the 1994 book of 23 patterns in three families) and why a pattern is a shared word, not a library you install.

Novice · OOP · Software Development · Updated November 17, 2026

By Gregor Dzierzon

## After this lesson you can

- Name a pattern's four parts: its name, the problem, the solution and the consequences
- Sort the classic patterns into their three families: making objects, fitting objects together, and changing behavior
- Explain why a pattern is a shared word that teams use, not a library you install

## Key takeaways

- Every pattern has four parts: a name, the problem it solves, the solution's shape, and its consequences, good and bad.
- The name is the useful part in a team: one word can carry a whole explanation, including what the fix costs.
- The idea came from the architect Christopher Alexander; the 1994 book by four authors, the Gang of Four, gave software 23 patterns.
- The 23 come in three families: making objects (creational), fitting objects together (structural), and changing behavior (behavioral).
- A pattern is a shared word and a shape, not code you install: you write it yourself, shaped to your problem and your language.

Picture a code review at work. A teammate has changed how the smart-home hub talks to an outside weather service, and their pull request comes with a long note: "The weather service answers in its own format, with temperatures in a field called `tmp_f` and the sky as a number from 1 to 9. I wrote a class that sits between it and our code. It takes our app's questions, asks the service in its format, and turns each answer into the shape our code expects, so nothing else in the app ever sees the service's format. If the service changes, only this class changes…" Thirty lines later, it's clear what they did.

Another reviewer reads the code and writes four words: "Nice, an adapter. Approved." Everyone on the team knows what that means: the shape of the fix, what it's good for, and what it costs. That's the power of a pattern's **name**. This lesson is about what a pattern is made of, where the idea came from, and why the names are worth learning.

## A pattern is a recipe card

A recipe card for banana bread doesn't only list steps. It says when to make it (you have bananas going brown), what to do, and what you get (a loaf that takes an hour and keeps for three days). You can follow it in any kitchen, with any oven, and your loaf won't look exactly like anyone else's.

A design pattern has the same four parts:

1. **The name**: one or two words a team can say ("Facade", "Observer").
2. **The problem**: the situation where it helps, and how to recognize it.
3. **The solution**: the shape of the fix: which pieces there are, and who calls whom. A shape, not finished code.
4. **The consequences**: what it gives you and what it costs. Every pattern costs something, usually more classes and more jumps for the reader to follow.

![A pattern's four parts as a recipe card, filled in for the car's start button: Name: Facade; Problem: many parts must be used together, in the right order; Solution: one simple front that calls the parts; Consequences: callers stay simple, but the front can grow too big](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/a637c0532665463e88448b3b0742e8a2.webp)

The fourth part is the one people forget. A pattern used where its problem isn't, only because it's a pattern, adds the costs without the benefits. The course has a name for that later, *pattern fever*, and every pattern lesson ends with when **not** to use it.

## Where the idea came from

The idea of a pattern didn't start in software. In 1977, the architect **Christopher Alexander** and his colleagues published *A Pattern Language*, a book of 253 patterns for towns and buildings. Each one described a problem that keeps coming up where people live and work, and the core of a solution that can be used again and again, never in quite the same way twice. One pattern says people want to sit near the light in a room, so a room should have a place by a window to sit.

Programmers read it and recognized something. In 1994, four software developers published *Design Patterns: Elements of Reusable Object-Oriented Software*, the book that gave programming 23 named patterns. The four authors became known as the **Gang of Four**, and you'll still see the book called "the Gang of Four book" or "GoF".

Here's the important part: **they didn't invent the 23 patterns.** They collected fixes that were already working in real software, fixes different teams had found on their own for the same problems. Someone wrote them down and gave them names.

## Three families

The book sorts its 23 patterns into three families, by what each one is for:

- **Making objects**, called **creational** patterns: how and where objects get created, so the rest of the code doesn't have to care.
- **Fitting objects together**, called **structural** patterns: how objects are joined, wrapped and combined into bigger ones.
- **Changing behavior**, called **behavioral** patterns: how objects share out the work and talk to each other, so behavior can change without rewrites.

![The 23 classic patterns in three families: making objects (Factory Method, Abstract Factory, Builder, Prototype, Singleton); fitting objects together (Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy); and the 11 that change behavior, from Chain of Responsibility to Visitor](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/8039ee8b482948c1a6d98e93d96ca6ad.webp)

You don't need to memorize these lists. Every one of the 23 has a home in this course, met when an app runs into its problem. The family is a useful first question, though: is my problem about making something, joining things, or changing what something does?

## A shared word, not a library

You can't download a Facade. A pattern isn't a package you install or a class you copy: it's a shape you build yourself, in your own language, around your own problem. Two apps with a Facade have different code in it. What they share is the idea, and the word for it.

That's why the names matter, even though the course teaches every problem before its name. In a team, "let's put an adapter in front of the weather service" says in five words what took thirty lines, and every developer who knows the word also knows what it will cost.

The 23 aren't the only patterns, either. Teams have named many since, a few of which you'll meet in this course (retrying a service that failed, for one), and teams make their own. The last module of the course is about doing exactly that.

## Check yourself

2 questions to try on the lesson page.

## So what

A pattern is a recipe card with a name on top: a problem, a fix that teams kept finding for it, and what that fix costs, all carried by one word that every developer who knows it understands.

## Key terms

- [Design Pattern](https://www.ask-codey.com/glossary/design-pattern)
- [Gang of Four](https://www.ask-codey.com/glossary/gang-of-four)
- [Creational Pattern](https://www.ask-codey.com/glossary/creational-pattern)
- [Structural Pattern](https://www.ask-codey.com/glossary/structural-pattern)
- [Behavioral Pattern](https://www.ask-codey.com/glossary/behavioral-pattern)

## Cheat sheets

- [A Recipe with a Name](https://www.ask-codey.com/cheat-sheets/dp-a-recipe-with-a-name-cheat-sheet)

Source: https://www.ask-codey.com/lessons/dp-a-recipe-with-a-name
