Enterprise Patterns MOC

Enterprise Patterns MOC

Map of Content for enterprise-grade software patterns. Covers four domains: Domain-Driven Design (DDD) tactical patterns, Enterprise Integration Patterns (EIP), CQRS and Event Sourcing, and Saga patterns for distributed transaction coordination.


DDD Patterns (Phase 10)

PatternIntentWhen to Use
Value-ObjectImmutable domain concept defined by attributes, not identityData that represents measurements, amounts, or descriptors
AggregateConsistency boundary around a cluster of domain objectsEnforcing business invariants across related entities
RepositoryCollection-like interface for accessing domain objectsDecoupling domain logic from persistence infrastructure
Domain-EventsRecord of something significant that happened in the domainCross-aggregate communication without tight coupling
Bounded-ContextExplicit boundary within which a domain model appliesLarge systems with multiple teams or conflicting models
Anti-Corruption-Layer-PatternTranslation layer preventing foreign model corruptionIntegrating with legacy systems or external services

DDD selection guide: Use DDD patterns when the domain is complex enough that a simple CRUD model leads to an anaemic domain. If your service is mostly data in/data out with no business rules, DDD adds unnecessary ceremony.


EIP Patterns (Phase 11)

PatternIntentWhen to Use
Pipes-and-FiltersDecompose processing into independent, composable stagesMulti-step message transformation or enrichment
Message-RouterRoute messages to different destinations based on content or rulesContent-based routing, recipient lists, dynamic routing
AggregatorCombine multiple related messages into a single composite messageCollecting responses from splitter or scatter-gather
SplitterBreak a composite message into individual messages for parallel processingBatch processing, fan-out to specialised handlers
Dead-Letter-QueueQuarantine unprocessable messages for later inspectionAny messaging system where message loss is unacceptable
Idempotent-ConsumerEnsure processing a message more than once has no additional effectAt-least-once delivery, saga compensation, retry scenarios

EIP selection guide: Use EIP patterns when services communicate via asynchronous messages. If your system uses synchronous REST/gRPC exclusively, EIP patterns add message infrastructure overhead without benefit.


CQRS and Event Sourcing (Phase 12)

PatternIntentWhen to Use
CQS-PrincipleSeparate methods that change state from methods that read stateAny codebase — CQS is a method-level discipline, not an architecture
CQRS-PatternSeparate read and write models at the service level~10x read/write scaling difference or genuinely complex command logic
Event-Sourcing-PatternPersist state as an append-only sequence of domain eventsAudit trail, temporal queries, event-driven architecture
ProjectionsBuild read-optimised views by replaying events from the event storeCQRS read side, reporting, materialised views

CQRS/ES selection guide: CQRS and Event Sourcing are independent patterns often combined. Do NOT adopt CQRS unless you have a ~10x read/write scaling difference. Do NOT adopt Event Sourcing unless you need a complete audit trail or temporal queries.


Saga Patterns (Phase 13)

PatternIntentWhen to Use
Choreography-Saga-PatternDecentralised saga where services react to domain events2-3 service flows with no strict ordering requirement
Orchestration-Saga-PatternCentralised saga with a coordinator managing the workflowBranching flows, strict ordering, complex rollback
Compensating-TransactionsSemantic undo of completed saga steps on failureAny saga pattern where forward steps can fail

Saga selection guide: Use saga patterns for distributed transactions across 3+ services. For 2-service flows, use simple retry-with-compensation. Choreography for simple event chains; orchestration (Temporal/Axon) for anything with branching or complex compensation.


Cross-Layer Lineage Chains

Navigable wikilink sequences showing how patterns in different domains inherit from and extend one another.

ChainLineage
Event-DrivenObserver-Pattern -> Domain-Events -> Event-Sourcing-Pattern -> CQRS-Pattern -> Choreography-Saga-Pattern
Command/DispatchCommand-Pattern -> CQRS-Pattern -> Orchestration-Saga-Pattern -> Message-Router
EncapsulationFacade-Pattern -> Anti-Corruption-Layer-Pattern -> Strangler Fig -> API Gateway
Proxy/InterceptionProxy-Pattern -> Ambassador -> Sidecar -> Service Mesh
Strategy/VariationStrategy-Pattern -> Feature Flags -> Canary -> Blue/Green
Decorator/MiddlewareDecorator-Pattern -> Pipes-and-Filters -> Sidecar
AggregationComposite-Pattern -> Aggregate -> Aggregator
Data AccessPrototype-Pattern -> Value-Object (copy semantics)

Note: Patterns without wikilinks (Strangler Fig, Ambassador, Sidecar, Service Mesh, Feature Flags, Canary, Blue/Green, API Gateway) are created in Phases 14-15. Links will resolve after those phases execute.