Skip to content
aipatterns.dev

Design patterns

The 22 classic object-oriented patterns, each with forces, a structure diagram, examples in TypeScript, Python, Go and Java, and a section on when not to use it. Not sure you need one? Read Choosing a pattern first.
View as Markdown

Patterns that control how objects get built, so callers depend on what they need rather than on which concrete class supplies it.

Patterns that combine objects and classes into larger structures while keeping each part replaceable and its interface small.

Patterns that assign responsibilities and route requests between objects, so behavior can change without rewriting the code that triggers it.

Patterns for calls that can fail, hang or come back wrong: bound the wait, count the failures, space the repeats, and continue with a lesser answer.

Data Patterns

5 entries

Patterns for keeping application data honest at speed and across services: copies that exist only to be lost, multi-step transactions with explicit undos, and messages that cannot be lost or doubled.

Patterns for system boundaries and change over time: replace without stopping, and give each client a backend shaped for it - decisions measured in routes and releases, not classes.