Design Patterns Vocabulary
5 exercises — practise the English vocabulary engineers use when discussing GoF design patterns: creational pattern distinctions, observer vs. pub/sub, decorator wrapping, facade simplification, and the adapter vs. bridge distinction.
0 / 5 completed
1 / 5
Your tech lead describes the Factory Method pattern: "It lets subclasses decide which class to instantiate." A colleague asks which pattern goes further by providing "an abstract interface for creating families of related objects without specifying their concrete classes." Which pattern is your colleague describing?
Creational pattern vocabulary comparison:
The Abstract Factory is the correct answer. It extends Factory Method by grouping related factories behind a common interface, ensuring that the products from a single factory are compatible with each other.
How to use this in an architecture discussion: "We're using an Abstract Factory so the UI layer can switch between the Material and Fluent design systems without touching the component consumers — the factory guarantees the products are always from the same family."
The Abstract Factory is the correct answer. It extends Factory Method by grouping related factories behind a common interface, ensuring that the products from a single factory are compatible with each other.
| Pattern | Creates | Key vocabulary | Example |
|---|---|---|---|
| Factory Method | One product via subclass override | "lets subclasses decide which class to instantiate" | LoggerFactory.create() |
| Abstract Factory | Families of related products | "interface for creating families… without specifying concrete classes" | UIFactory → Button + Checkbox (per OS theme) |
| Builder | One complex object step by step | "separates construction from representation" | QueryBuilder.select().where().limit() |
| Prototype | Copies of existing instances | "cloning", "copy constructor" | config.clone() with overrides |
How to use this in an architecture discussion: "We're using an Abstract Factory so the UI layer can switch between the Material and Fluent design systems without touching the component consumers — the factory guarantees the products are always from the same family."