Skip to content
all episodes
Code of Architecture · episode 03

Learning Domain-Driven Design — Chapter 2, Part 2

1:00:21

Episode participants

The complete participant roster has not yet been confirmed by the available sources.

Conversation

What we discussed on the recording

The third session covers architectural patterns and bounded-context communication. Layered Architecture divides presentation, application, business logic, and data access. It fits simple subdomains using Transaction Script or Active Record, but making the domain depend on infrastructure obstructs a rich domain model.

Ports and Adapters reverses the dependency: business logic defines ports and technical details attach as adapters. Hexagonal, Onion, and Clean Architecture are forms of this idea. CQRS separates a consistent command model from read projections, while event sourcing enables different synchronous or asynchronous views.

Architecture is selected per bounded context. A consumer translates a model through an anti-corruption layer, or a provider offers an open-host service and published language. An aggregator combines several sources, sometimes with its own storage; a BFF can solve a similar client-facing problem.

Publishing domain events before or after commit leaves different failure windows. A transactional outbox stores data and the event together, then publishes with at-least-once semantics. A saga coordinates work across aggregates: events drive a linear chain, while a branching process that makes decisions becomes a process manager.