Design Patterns

The 23 Gang of Four patterns, the SOLID principles behind them, and when each pattern helps or hurts.

Design patterns are named, reusable solutions to recurring object-oriented design problems. This section follows the classification in Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, Helm, Johnson, Vlissides, 1994) — the “Gang of Four” (GoF). Each pattern is taught with a Java 21 example that CI compiles and runs.

Start with What Are Design Patterns? and SOLID Principles. Then read OO design principles behind the patterns and use the overview of all 23 patterns as your map. All 23 patterns are published; Compound patterns and MVC shows how they combine.

Topics in this section

Articles

Planned topics

These topics are on the roadmap and not written yet. They appear here so you can see the full scope of the section.

  • Refactoring toward patterns: worked examples
  • Anti-patterns and pattern overuse