Repaso
Español

The classic GoF design patterns are grouped into which three categories?

Options

  1. Fast, medium and slow, by how quickly they run
  2. Creational, Structural and Behavioral (Correct option)
  3. Frontend, backend and database patterns
  4. Public, private and protected patterns

Answer

Creational (how objects are created), Structural (how objects are combined), Behavioral (how objects communicate)

Why

The book "Design Patterns" by the Gang of Four (GoF) lists 23 patterns in three groups:

  • Creational: Singleton, Factory Method, Abstract Factory, Builder, Prototype. They control object creation.
  • Structural: Adapter, Decorator, Facade, Proxy, Composite, Bridge, Flyweight. They combine classes into larger structures.
  • Behavioral: Strategy, Observer, Command, Template Method, State, Iterator, Chain of Responsibility. They define how objects interact.

A pattern is a proven solution to a recurring design problem, not code you copy.

Remember

Creational = create. Structural = compose. Behavioral = interact.

Key terms

Practice this question in Repaso