Skip to main content
Back to Tags

Design Pattern

180 items tagged with "design-pattern"

Filter by type:

Patterns149

Pattern

Factory Method

Defines an interface for creating an object but lets subclasses decide which concrete class to instantiate, deferring instantiation to subclasses.

Pattern

Abstract Factory

Provides an interface for creating families of related objects without specifying their concrete classes, ensuring products from one family are used together.

Pattern

Builder

Separates the construction of a complex object from its representation so the same construction process can create different representations step by step.

Pattern

Prototype

Creates new objects by cloning an existing instance (the prototype) rather than instantiating a class, useful when construction is costly or types are decided at runtime.

Pattern

Singleton

Ensures a class has only one instance and provides a global point of access to it, used for shared resources like configuration, logging, or connection pools.

Pattern

Object Pool

Reuses a set of pre-initialized, expensive-to-create objects from a managed pool instead of creating and destroying them on demand, improving performance.

Pattern

Dependency Injection

Supplies an object's dependencies from the outside rather than having it construct them, inverting control to improve testability, flexibility, and decoupling.

Pattern

Lazy Initialization

Defers the creation or computation of an object until the first time it is actually needed, avoiding upfront cost for resources that may never be used.

Pattern

Multiton

Generalizes Singleton to manage a fixed, keyed set of named instances, ensuring exactly one instance exists per key through a registry.

Pattern

Registry

Provides a well-known central object where shared instances or services can be registered and looked up by key, giving a single point of access without scattered globals.

Pattern

Adapter

Converts the interface of a class into another interface clients expect, letting classes that could not otherwise collaborate work together.

Pattern

Bridge

Decouples an abstraction from its implementation so the two can vary independently, avoiding a combinatorial explosion of subclasses.

Pattern

Composite

Composes objects into tree structures to represent part-whole hierarchies, letting clients treat individual objects and compositions uniformly.

Pattern

Decorator

Attaches additional responsibilities to an object dynamically by wrapping it, providing a flexible alternative to subclassing for extending behavior.

Pattern

Flyweight

Minimizes memory use by sharing as much data as possible between many similar objects, separating intrinsic shared state from extrinsic context-specific state.

Pattern

Proxy

Provides a surrogate or placeholder for another object to control access to it, enabling lazy loading, access control, caching, or remote access.

Pattern

Module

Encapsulates related code into a single self-contained unit with a controlled public interface and hidden private state, organizing code and avoiding global namespace pollution.

Pattern

Marker Interface

Uses an empty interface to tag a class with metadata so other code can detect the capability at runtime via type checks, without adding any methods.

Pattern

Mixin

Composes reusable units of behavior into a class without inheritance, letting unrelated classes share functionality by mixing in shared method sets.

Pattern

Extension Object

Lets you add new interfaces and behavior to a class over time without changing it, by attaching extension objects that clients query for at runtime.

Pattern

Private Class Data

Restricts accessor-write access to class attributes by isolating data in a separate object exposed read-only after construction, enforcing immutability and encapsulation.

Pattern

Front Controller

Channels all incoming requests through a single handler that centralizes cross-cutting concerns like routing, authentication, and logging before dispatching to handlers.

Pattern

Strategy

Defines a family of interchangeable algorithms behind a common interface so the algorithm can vary independently from the clients that use it.

Pattern

Observer

Establishes a one-to-many dependency so that when one object changes state, all its dependents are notified and updated automatically.

Pattern

Command

Encapsulates a request as an object, letting you parameterize, queue, log, and undo operations independently of who invokes them.

Pattern

Iterator

Provides a uniform way to traverse the elements of a collection sequentially without exposing its underlying representation.

Pattern

Mediator

Centralizes complex communication between objects in a mediator so components refer to it instead of to each other, reducing coupling.

Pattern

Memento

Captures and externalizes an object's internal state so it can be restored later without violating encapsulation.

Pattern

State

Lets an object alter its behavior when its internal state changes, appearing to change class by delegating to state-specific objects.

Pattern

Template Method

Defines the skeleton of an algorithm in a base method, deferring specific steps to subclasses so they can vary parts without changing the structure.

Pattern

Visitor

Separates an algorithm from the object structure it operates on, letting you add new operations over a class hierarchy without modifying it.

Pattern

Chain of Responsibility

Passes a request along a chain of handlers, each deciding to process it or forward it, decoupling sender from the specific receiver.

Pattern

Interpreter

Defines a grammar for a simple language and an interpreter that evaluates sentences in that language using a class per grammar rule.

Pattern

Null Object

Provides a do-nothing object with neutral behavior in place of null, eliminating null checks and special-case handling.

Pattern

Specification

Encapsulates a business rule as a reusable, combinable predicate object that tells whether a candidate satisfies the rule.

Pattern

Publish-Subscribe

Decouples senders from receivers by routing messages through a broker or channel so publishers and subscribers never reference each other.

Pattern

Servant

Defines shared behavior for a group of classes in a separate servant object that operates on them, instead of duplicating the behavior in each class.

Pattern

Blackboard

Coordinates independent specialized components that incrementally build a shared solution on a common data store for ill-defined problems.

Pattern

Repository

Mediates between the domain and data mapping layers via a collection-like interface for accessing domain objects, hiding persistence details.

Pattern

Unit of Work

Tracks objects affected by a business transaction and coordinates writing out changes and resolving concurrency as a single commit.

Pattern

Data Mapper

Moves data between objects and a database while keeping them independent, so domain objects carry no persistence knowledge.

Pattern

Active Record

Wraps a database row in an object that carries both the data and the methods to load, save, and delete itself.

Pattern

Value Object

Models a concept defined by its attributes rather than identity, making it immutable and compared by value to keep the domain expressive and safe.

Pattern

Domain Event

Captures something significant that happened in the domain as an explicit object, decoupling the trigger from the reactions to it.

Pattern

API Gateway

A single entry point that routes, aggregates, and secures client requests across many backend microservices.

Pattern

Service Registry

A database of available service instances and their network locations, kept current as instances start, stop, and fail.

Pattern

Service Discovery

A mechanism for clients to find the current network location of a service without hard-coding addresses.

Pattern

Ambassador

An out-of-process helper that proxies network calls on behalf of an application, handling connectivity concerns transparently.

Pattern

Adapter Microservice

A microservice that translates between an application and an external system with an incompatible interface or protocol.

Pattern

Service Mesh

A dedicated infrastructure layer that manages service-to-service communication via co-located proxies and a central control plane.

Pattern

API Composition

Implements a query that spans multiple services by invoking each owner service and joining the results in memory.

Pattern

CQRS (Command Query Responsibility Segregation)

Separates the model that writes data (commands) from the model that reads it (queries) so each can be optimized independently.

Pattern

Transactional Outbox

Reliably publishes messages by writing them to an outbox table in the same local transaction as the business data change.

Pattern

Change Data Capture (CDC)

Captures row-level changes from a database's transaction log and streams them as events to downstream consumers.

Pattern

Aggregator

A component that invokes multiple services and combines their responses into a single consolidated result for the caller.

Pattern

Gateway Aggregation

Uses a gateway to combine multiple backend requests into one, so clients make a single call instead of many.

Pattern

Gateway Offloading

Moves shared cross-cutting functionality such as TLS, auth, and rate limiting out of services and into a gateway.

Pattern

Gateway Routing

Routes client requests to the correct backend service through a single endpoint using request attributes such as path or host.

Pattern

Leader Election

Designates a single instance among many to coordinate work, with automatic failover if the leader becomes unavailable.

Pattern

Distributed Lock

Coordinates exclusive access to a shared resource across multiple processes or nodes that do not share memory.

Pattern

Consistent Hashing

Distributes keys across nodes so that adding or removing a node remaps only a small fraction of keys.

Pattern

Sharding

Horizontally partitions a data store into independent shards so capacity and load scale beyond a single node.

Pattern

Scatter-Gather

Broadcasts a request to multiple recipients in parallel, then aggregates their replies into a single response.

Pattern

Choreography

Coordinates a distributed workflow through services reacting to each other's events, with no central controller.

Pattern

Orchestration

Coordinates a distributed workflow through a central orchestrator that explicitly invokes each service in sequence.

Pattern

Externalized Configuration

Stores configuration outside the application artifact so the same build runs unchanged across environments.

Pattern

Cache-Aside

Load data into a cache on demand from a data store to improve read performance and reduce load on the backing store.

Pattern

Competing Consumers

Enable multiple concurrent consumers to process messages from the same queue to increase throughput and improve resilience.

Pattern

Queue-Based Load Leveling

Use a queue between tasks and a service to smooth intermittent heavy loads and protect the service from being overwhelmed.

Pattern

Throttling

Control the consumption of resources by an instance, tenant, or service so a system stays within capacity under load.

Pattern

Claim Check

Store a large message payload externally and pass only a reference through the messaging system to avoid moving bulky data.

Pattern

Valet Key

Issue a client a token granting scoped, time-limited direct access to a resource, offloading data transfer from the application.

Pattern

Gatekeeper

Protect services by brokering all client requests through a dedicated host that validates and sanitizes them before forwarding.

Pattern

Federated Identity

Delegate authentication to an external identity provider so applications trust tokens rather than managing credentials themselves.

Pattern

Compensating Transaction

Undo the completed steps of a multi-step operation when one step fails, restoring consistency without distributed ACID transactions.

Pattern

Geode

Deploy independent geographically distributed nodes that each serve any request, placing compute close to users worldwide.

Pattern

Deployment Stamps

Deploy multiple independent copies of a full application stack to scale, isolate tenants, and contain failures.

Pattern

Static Content Hosting

Serve static assets from storage or a CDN instead of application servers to cut load, latency, and cost.

Pattern

External Configuration Store

Move configuration out of deployment packages into a central external store shared and updated across application instances.

Pattern

Health Endpoint Monitoring

Expose health-check endpoints that monitoring tools and load balancers probe to verify an application is functioning correctly.

Pattern

Index Table

Create secondary index tables over data stores queried by non-key fields to speed up lookups that would otherwise scan.

Pattern

Materialized View

Precompute and store read-optimized views of data so expensive queries become fast lookups against ready-made results.

Pattern

Pipes and Filters

Decompose complex processing into a sequence of independent components connected by channels so each step can scale and evolve.

Pattern

Sequential Convoy

Process related messages in order while still processing unrelated messages in parallel, by grouping them into ordered sets.

Pattern

Rate Limiting

Constrain the rate of operations against a service or resource to stay within quotas and avoid throttling or overload.

Pattern

Retry

Automatically reattempt a failed operation that is likely transient, using backoff and limits to recover without user impact.

Pattern

Message Channel

Connects two applications with a logical pipe so a sender can transmit data to a receiver without knowing the receiver's location or identity.

Pattern

Point-to-Point Channel

Ensures exactly one receiver consumes each message on a channel, even when multiple consumers compete, so a message is processed once.

Pattern

Publish-Subscribe Channel

Broadcasts each message to all interested subscribers so one event can notify many independent consumers without the publisher knowing them.

Pattern

Message Router

Consumes a message and redirects it to a different channel based on conditions, decoupling producers from the decision of where messages should go.

Pattern

Content-Based Router

Routes each message to a destination channel chosen by inspecting the message's content, so the payload itself determines where it is delivered.

Pattern

Message Filter

Lets only messages meeting specified criteria pass through a channel and silently discards the rest, so consumers receive only relevant messages.

Pattern

Splitter

Breaks a composite message into a series of individual messages so each element can be processed independently downstream.

Pattern

Message Translator

Converts a message from one data format or schema to another so systems with incompatible representations can communicate.

Pattern

Content Enricher

Augments a message with additional data from an external source when the original lacks information the receiver requires.

Pattern

Normalizer

Translates messages arriving in many different formats into a single common format so downstream components handle one canonical representation.

Pattern

Polling Consumer

A consumer that explicitly checks a channel for messages on its own schedule, controlling exactly when and how fast it receives them.

Pattern

Event-Driven Consumer

A consumer that is invoked by the messaging system the moment a message arrives, reacting to messages instead of polling for them.

Pattern

Idempotent Receiver

Makes a consumer safely handle duplicate messages so that processing the same message more than once has the same effect as processing it once.

Pattern

Dead Letter Channel

Routes messages that cannot be delivered or processed to a dedicated channel for inspection and recovery instead of discarding or blocking them.

Pattern

Guaranteed Delivery

Persists messages so they are not lost if the sender, broker, or receiver fails, ensuring each message is eventually delivered despite outages.

Pattern

Request-Reply

Lets a requestor send a message and receive a corresponding response over messaging, combining two one-way channels into a logical two-way exchange.

Pattern

Correlation Identifier

Tags messages with a unique id that links related messages together, so a reply can be matched to its request and parts to their whole.

Pattern

Wire Tap

Copies messages flowing through a channel to a secondary channel for inspection, logging, or analysis without disturbing the primary flow.

Pattern

Routing Slip

Attaches a sequence of processing steps to a message so it routes itself through a series of components determined per message at runtime.

Pattern

Process Manager

A central component that maintains the state of a multi-step message flow and decides the next step, coordinating complex or branching workflows.

Pattern

Read-Through Cache

A caching strategy where the cache itself loads missing data from the backing store on a miss, so application code reads only from the cache.

Pattern

Write-Through Cache

A caching strategy where every write goes to the cache and the backing store synchronously, keeping the two consistent at the cost of write latency.

Pattern

Write-Behind Cache

A caching strategy where writes update the cache immediately and are flushed to the backing store asynchronously, maximizing write throughput at the cost of durability.

Pattern

Refresh-Ahead Cache

A caching strategy that proactively reloads hot entries before they expire, so reads of popular keys never pay miss latency.

Pattern

Materialized View

A precomputed, stored result set that trades storage and refresh cost for fast reads of expensive queries, aggregations, or denormalized projections.

Pattern

Polyglot Persistence

An architecture that uses multiple, purpose-fit data stores within one system, matching each store's strengths to each data access pattern.

Pattern

Command Query Responsibility Segregation (CQRS)

Separates the write model that handles commands from the read model that serves queries, letting each be optimized, scaled, and evolved independently.

Pattern

Event-Driven Architecture

An architectural style where components communicate by producing and reacting to events, enabling loose coupling, asynchronous flow, and independent scaling.

Pattern

Lambda Architecture

A big-data design that runs a batch layer for accurate historical views and a speed layer for low-latency recent data, merging both at query time.

Pattern

Kappa Architecture

A streaming-first data design that uses a single processing path over an immutable log, reprocessing history by replay instead of a separate batch layer.

Pattern

Medallion Architecture

A lakehouse data-organization pattern that refines data through bronze (raw), silver (cleaned), and gold (curated) layers for progressive quality and reuse.

Pattern

Data Lakehouse

A data architecture that adds warehouse-style ACID tables, schema, and governance directly on low-cost data-lake storage, unifying analytics and ML on one platform.

Pattern

Star Schema

A dimensional data-modeling pattern with a central fact table linked to denormalized dimension tables, optimized for fast, intuitive analytical queries.

Pattern

Slowly Changing Dimension (SCD)

Techniques for handling changes to dimension attributes over time in a data warehouse, ranging from overwriting to preserving full historical versions.

Pattern

Idempotent Writer

A pattern that makes repeated writes safe by ensuring duplicate operations produce the same result, essential for at-least-once delivery and retries.

Pattern

Producer-Consumer

A concurrency pattern where producers place work on a shared bounded queue and consumers process it independently, decoupling rates and smoothing load.

Pattern

Thread Pool

A concurrency pattern that reuses a fixed set of worker threads to execute many tasks, avoiding per-task thread creation cost and bounding concurrency.

Pattern

Actor Model

A concurrency model where independent actors encapsulate state and communicate only by asynchronous messages, avoiding shared memory and locks.

Pattern

Reactor

An event-handling pattern that demultiplexes I/O events on one or few threads and dispatches them synchronously to registered handlers, enabling scalable non-blocking servers.

Pattern

Optimistic Concurrency Control

A concurrency strategy that lets transactions proceed without locking and validates at commit, retrying on conflict, assuming conflicts are rare.

Pattern

Pessimistic Locking

A concurrency strategy that acquires locks on data before use to prevent concurrent modification, ensuring correctness under high contention at the cost of throughput.

Pattern

Two-Phase Commit (2PC)

A distributed-transaction protocol that coordinates multiple participants to commit or abort atomically through a prepare phase and a commit phase.

Pattern

Container/Presentational Pattern

Separates components that fetch and manage data (containers) from components that only render UI from props (presentational), improving reuse and testability.

Pattern

Higher-Order Component (HOC)

A function that takes a component and returns a new component with added behavior, enabling cross-cutting concerns to be shared without inheritance.

Pattern

Render Props

A component shares logic by accepting a function prop that it calls with internal state, letting the caller control rendering while reusing behavior.

Pattern

Custom Hooks

Extracts reusable stateful logic from React function components into named hook functions, sharing behavior without wrapper components or prop drilling.

Pattern

Compound Components

A set of components that work together and share implicit state through context, giving consumers a flexible, declarative API for a composite widget.

Pattern

Provider Pattern

Distributes shared state or services to a component subtree through context, avoiding prop drilling and centralizing access to cross-cutting data.

Pattern

Model-View-Controller (MVC)

Separates an application into a model (data and rules), a view (presentation), and a controller (input handling), decoupling concerns for maintainability.

Pattern

Model-View-ViewModel (MVVM)

Separates UI from logic via a view-model that exposes bindable state and commands, with two-way data binding keeping the view and view-model in sync.

Pattern

Micro Frontend

Decomposes a web frontend into independently developed and deployed pieces owned by separate teams, then composes them into one application at runtime or build time.

Pattern

Island Architecture

Renders a page as mostly static HTML with isolated interactive 'islands' that hydrate independently, minimizing JavaScript shipped to the browser.

Pattern

Pagination

Splits a large result set into smaller pages so APIs and UIs can return and traverse data incrementally instead of loading everything at once.

Pattern

HATEOAS

Hypermedia as the Engine of Application State: REST responses include links describing available actions, letting clients navigate the API by following links.

Pattern

Idempotency Key

A client-supplied unique key lets a server detect and dedupe retried requests, so repeated submissions produce the same result exactly once.

Pattern

API Versioning

Strategies for evolving an API without breaking existing clients, by exposing multiple versions through URLs, headers, or media types.

Pattern

Webhook

A server pushes event notifications to a client-registered HTTP endpoint as events occur, replacing inefficient polling with real-time callbacks.

Pattern

Defense in Depth

Layers multiple independent security controls so that if one fails, others still protect the system, avoiding reliance on any single defense.

Pattern

Principle of Least Privilege

Grants every user, process, and service only the minimum permissions needed for its task, limiting the blast radius of compromise or error.

Pattern

Token Bucket (Rate Limiting)

A rate-limiting algorithm where requests consume tokens refilled at a steady rate, allowing controlled bursts while capping the long-run request rate.

Pattern

Secrets Rotation

Regularly replacing credentials, keys, and tokens, ideally automatically, to limit the time window in which a leaked or compromised secret is useful.

Pattern

Secure by Default

Systems ship with the most secure configuration out of the box, requiring deliberate action to reduce security rather than to enable it.

Pattern

Zero Trust Segmentation

Eliminates implicit network trust by authenticating and authorizing every request and dividing the network into fine-grained, individually protected segments.

Anti-Patterns21

Anti-Pattern

God Object

A single class or module that knows or does too much, concentrating most of the system's responsibilities in one place and becoming a maintenance bottleneck.

Anti-Pattern

Big Ball of Mud

A system with no discernible architecture, where code is haphazardly structured, tangled, and duct-taped together, making every change risky and slow.

Anti-Pattern

Accidental Complexity

Complexity introduced by the solution rather than the problem — overbuilt tooling, layers, and abstractions that obscure logic that is actually simple.

Anti-Pattern

Inner-Platform Effect

Building a configurable system so general it becomes a poor reimplementation of the platform it runs on, reinventing a language, database, or framework badly.

Anti-Pattern

Swiss Army Knife

An interface or component with so many options and overloads that it tries to cover every use case, becoming hard to learn, misuse-prone, and impossible to evolve.

Anti-Pattern

Magic Pushbutton

Putting business logic directly in UI event handlers, so a single button click handler holds validation, rules, and persistence with no separation of concerns.

Anti-Pattern

Circular Dependency

Two or more modules that depend on each other directly or transitively, forming a cycle that prevents independent building, testing, and reasoning.

Anti-Pattern

Leaky Abstraction

An abstraction that fails to fully hide its underlying implementation, forcing callers to understand and depend on the details it was meant to encapsulate.

Anti-Pattern

Anemic Domain Model

Domain objects that hold data but no behavior, with all logic pushed into separate service classes, draining the object model of its purpose.

Anti-Pattern

Fat Controller

Web or API controllers that accumulate business logic, validation, and data access instead of delegating, becoming bloated and impossible to test or reuse.

Anti-Pattern

Smart UI

Concentrating business logic, data access, and rules inside the presentation layer, fusing UI and domain so neither can change or be tested independently.

Anti-Pattern

Over-Engineering

Building more generality, flexibility, or sophistication than the problem requires, adding cost and complexity for capabilities that are never actually needed.

Anti-Pattern

Premature Abstraction

Extracting abstractions before enough concrete cases exist to know what they should be, locking in the wrong shape and adding indirection that obstructs change.

Anti-Pattern

Spaghetti Code

Code with tangled, unstructured control flow and no clear modularity, where execution jumps unpredictably and dependencies are impossible to follow.

Anti-Pattern

Boolean Trap

Function parameters that take a bare boolean force readers to decode opaque true/false call sites, hiding intent and inviting wrong arguments.

Anti-Pattern

Null Checking Everywhere

Defensive null checks scattered through the codebase to guard against nulls that could be designed away, cluttering logic and still missing cases.

Anti-Pattern

Yo-Yo Problem

An inheritance hierarchy so deep that understanding behavior forces constant scrolling up and down between many classes to trace a single call.

Anti-Pattern

Call Super

A framework requiring subclass overrides to call the parent method, a fragile contract that breaks silently whenever a developer forgets the call.

Anti-Pattern

Temporal Coupling

Methods that must be called in a specific hidden order, where calling them out of sequence silently breaks state with no compiler protection.

Anti-Pattern

Switch Statement Smell

Repeated switch or if-else chains branching on a type code, duplicated across the codebase, that should be replaced by polymorphism.

Anti-Pattern

Sequential Coupling

A class designed so its methods must be invoked in a rigid sequence, with the ordering enforced only by convention rather than by the API itself.

Glossaries7

Glossary

Modular Monolith

A modular monolith is a single deployable application whose internal code is organized into well-isolated modules with explicit boundaries, combining a monolith's simple operations with microservice-style separation of concerns.

Glossary

Domain-Driven Design

Domain-driven design (DDD) is a software design approach that models software closely on the business domain, using a shared language between developers and domain experts and organizing the system around bounded contexts.

Glossary

CQRS (Command Query Responsibility Segregation)

CQRS is a pattern that separates the model used to change data (commands) from the model used to read data (queries), allowing each side to be optimized, scaled, and evolved independently.

Glossary

Event Sourcing

Event sourcing is a pattern that stores the full history of changes to application state as an immutable sequence of events, reconstructing current state by replaying those events rather than storing only the latest snapshot.

Glossary

Immutability

Immutability is the property of data that cannot be changed after it is created; modifications produce new values instead of altering the original, which simplifies reasoning and concurrency.

Glossary

Pure Function

A pure function always returns the same output for the same input and has no side effects, meaning it does not read or modify any state outside its own arguments.

Glossary

Dependency Injection

Dependency injection is a design technique in which an object receives the other objects it depends on from an external source rather than creating them itself, improving testability and decoupling.