design

Practical resources about design for software engineers.

152 results

Patterns for Maintainable Code

Design patterns are not cookbook recipes — they are a shared vocabulary for discussing solutions to recurring problems. Knowing when to apply (and when to avoid) a pattern is a hallmark of senior engineering.

Browse our catalog of creational, structural, and behavioral patterns. Each entry includes a real-world scenario, UML diagrams, implementation in multiple languages, and a discussion of trade-offs. From Singleton to Outbox, find the right tool for your context.

beginner

Data Access Object (DAO) Pattern

Abstract and encapsulate all access to a data source by exposing a clean interface while hiding...

intermediate

Data Mapper Pattern

Separate in-memory domain objects from the database by delegating persistence to a dedicated mapper...

intermediate

Database per Service Pattern

Give each microservice its own private database to ensure loose coupling, independent deployment,...

intermediate

Decorator Pattern

Add new functionality to objects dynamically by wrapping them. A structural design pattern for...

intermediate

Decorator Pattern for HTTP Request Pipelines

Use the Decorator pattern to compose cross-cutting concerns like logging, metrics, and retries into...

intermediate

Dependency Injection Pattern

Supply dependencies from outside rather than creating them internally. An architectural pattern for...

intermediate

Dependency Injection Container in TypeScript

Build a lightweight DI container that resolves class dependencies automatically, enabling testable,...

intermediate

Distributed Lock Pattern

Coordinate mutually exclusive access to shared resources across distributed nodes using a...

intermediate

Domain Event Pattern

Capture and publish major occurrences within a domain model to decouple side effects from core...

intermediate

Eager Loading Pattern

Load related data in a single query rather than multiple round-trips, preventing the N+1 problem...

advanced

Entity-Component-System (ECS) Pattern

Compose entities from pure data components and process them with systems, enabling high-performance...

intermediate

Event Bus Pattern

Decouple components by routing events through a central bus. A behavioral pattern for loosely...

intermediate

Event-Carried State Transfer Pattern

Replicate state changes across services by publishing events that carry the full updated entity...

advanced

Event Sourcing Pattern

Store the state of an application as a sequence of events rather than storing only the current...

beginner

Facade Pattern

Provide a simplified interface to a complex subsystem. A structural pattern that hides...

beginner

Factory Pattern

Create objects without specifying the exact class to instantiate. A creational design pattern for...

intermediate

Flyweight Pattern

Share objects to support large numbers of fine-grained objects efficiently. A structural design...

intermediate

Flyweight Pattern for Efficient Large-Scale Object Sharing

Use the Flyweight pattern to minimize memory usage by sharing as much data as possible between...

intermediate

Front Controller Pattern

Route all incoming requests through a single handler that dispatches to the appropriate page...

intermediate

Gatekeeper Pattern

Place a validation and security boundary at the edge of a system to inspect, sanitize, and...

No results found.