What you will learn in Clean Applications with Hexagonal Architecture
Building maintainable microservices and modular monoliths
Chapter by chapter
Chapter 1: Taming complexity with hexagons
The introduction explains how hard-wired dependencies create accidental complexity and presents hexagonal architecture as a way to contain the effects of change.
What you learn in chapter 1 →Chapter 2: WriteFlow's wake-up call: When good architecture intentions aren't enough
Introduces WriteFlow as a case study and previews the chapter’s map for migrating a layered monolith to hexagonal architecture.
What you learn in chapter 2 →Chapter 3: Building the domain core
The introduction argues that WriteFlow’s migration should begin with a framework-independent domain core whose business rules prevent invalid states.
What you learn in chapter 3 →Chapter 4: The honest hexagon: Use cases, commands, and the case against exceptions
Introduces the application layer’s coordinating role and explains why use case contracts should make failure explicit without changing what commands return on success.
What you learn in chapter 4 →Chapter 5: Crossing the boundaries: Adapters, repositories, and the mapping problem
This introduction explains how input and output adapters connect WriteFlow’s completed application core to the outside world, and why repositories are an unusual kind of output port.
What you learn in chapter 5 →Chapter 6: The running hexagon: From pieces to system
The introduction explains why WriteFlow’s independently built hexagonal components need runtime assembly to become a working application.
What you learn in chapter 6 →Chapter 7: Enforcing the architecture as executable specification
The introduction explains why Maven module boundaries need ArchUnit tests to catch class-level architectural violations and keep WriteFlow’s intended architecture visible and enforceable.
What you learn in chapter 7 →Chapter 8: Testing the hexagon with behavioral verification
The introduction explains why structural checks of WriteFlow’s hexagon must be complemented by behavioral tests.
What you learn in chapter 8 →Chapter 9: Building WriteFlow: The complete implementation
The introduction explains how WriteFlow’s previously built parts will form a runnable application and why two consumers of one domain event run in different transaction phases.
What you learn in chapter 9 →Chapter 10: When hexagons talk: Integration modes and the external architecture
This introduction frames external integration as a set of boundary decisions that teams must make explicitly, whether designing a new hexagon or examining an existing system.
What you learn in chapter 10 →Chapter 11: Synchronous boundaries: Anti-corruption layers and distributed read models
This introduction frames the model, availability, and data-ownership challenges of synchronous calls between bounded contexts.
What you learn in chapter 11 →Concepts explained in this book
- hexagonal architectureAn application design pattern that isolates the application core behind ports and connects external technologies through adapters.
- adapterAn adapter that connects an application to an external service through an API.
- outbound portAn application-facing boundary that declares a service the application requires from an external system.
- handlerA handler is an application component that processes a request and coordinates the interactions needed to fulfill it.
- driven adapterAn adapter that implements an output port and translates application requests into interactions with an external system.
- primary portAn interface exposing an application operation that an external caller can invoke.
- integration eventA published event contract representing an occurrence in a stable form suitable for consumers across system boundaries.
- EitherEither is a functional data type representing one of two alternatives, commonly a failure value or a successful result.
- commandA command object encapsulates data representing a requested application operation.
- driving adapterA primary adapter translates an external trigger into a call to an application input port.
- entityA domain object with an identity whose state and invariants are governed by domain rules.
- application coreThe central part of an application containing its domain and application logic while remaining independent of external technologies.
- REST controllerAn adapter that accepts REST requests and translates them into calls to application input ports.
- domain eventAn immutable representation of a significant occurrence expressed in the language of the business domain.
- always-valid domain modelA domain-modeling approach that prevents objects from representing states that violate their invariants.
- outbox patternA pattern that stores a message in the same transaction as a business change so it can be published reliably afterward.
- command and query busAn application component that accepts commands through a uniform interface and dispatches them to corresponding handlers.
- invariantA condition that must remain true for a domain object or business state to be valid.
- value objectA value object is an immutable domain object defined by its attributes rather than identity and responsible for enforcing the constraints of the concept it represents.
- factoryA construction abstraction that creates objects while encapsulating their creation logic.
- portAn application boundary interface through which external actors or technologies interact with the application core.
- queryA query is a request that retrieves information without changing application or domain state.
- projectionA projection is a read-only view containing selected data from a domain model rather than the domain entity itself.
- application serviceA service that coordinates an application use case and its domain operations without containing infrastructure concerns.
- unit testA testing technique that verifies small units of software in isolation from their dependencies.
- data transfer objectA data transfer object is a data-carrying type designed to convey structured information between software components without encapsulating domain behavior.
- moduleA module is a cohesive software unit whose implementation and dependencies are organized behind a defined boundary.
- read replicaA copy of data maintained from a source system and used to serve reads.
- dependency inversionA design principle stating that high-level and low-level components should depend on abstractions rather than concrete implementation details.
- use caseA use case is an application operation that coordinates domain rules to accomplish a specific user or system goal.
- system boundaryA structural separation that defines permitted responsibilities and dependencies between parts of a software system.
- composition rootA composition root is the application’s designated location for constructing components and wiring their dependencies.
- persistence adapterAn adapter that implements persistence contracts and translates between domain objects and storage technology.
- ArchUnitArchUnit is a Java library for expressing and testing architectural constraints in code.
- orchestrationThe coordination of collaborators to complete an application operation without owning the underlying business rules.
- architecture kernelThe Architecture Kernel is a book-specific framework-independent component that provides technology-agnostic annotations for expressing architectural intent.
- transaction boundaryA transaction boundary defines the scope within which a set of operations participates in one atomic transaction.
- dependency directionA constraint specifying which software components or layers are permitted to depend on one another.
- full bridgeA mapping strategy that isolates domain, persistence, and external API representations through separate request and response types.
- application layerA software layer that coordinates application operations and use cases above the domain layer.
- domain validationBusiness invariant validation checks whether domain data and operations satisfy the rules that must remain true for valid business state.
- event handlerA component that reacts to a published event by invoking additional behavior.
- mapperA mapper is a component or procedure that converts data between distinct representations.
- architectural testingArchitectural testing automatically checks whether a codebase conforms to specified structural and dependency rules.
- integration modeAn integration mode is a way for work or information to cross an architectural boundary, distinguished by waiting and responsibility for continuing work.
- domain modelA software representation of the concepts, relationships, and rules of a business domain.
- role interfaceAn interface whose operations express the specific capabilities required by its consumer rather than the full API of an implementation.
- command-query separationA software design principle that separates operations that change state from operations that return information without changing state.
- synchronous callA synchronous call is an interaction in which the caller waits for the called system to return an answer.
- business logicThe rules and processing that express an application's business behavior independently of external technologies.
- data mappingData mapping is the transformation of data between representations used by different system components or layers.
- exceptionAn exception is a Java control-flow mechanism that represents an abnormal condition by transferring execution to exception-handling code.
- domain serviceA domain service is a stateless domain-layer component that encapsulates business logic not naturally belonging to a single entity.
- anticorruption layerA translation boundary that protects a domain model from the concepts and representations of an external system.
- contract mapA diagram that shows an application’s neighboring systems and records the direction, intent, mode, and ownership of each interaction contract.
- header interfaceAn interface shaped around the complete public method set of an implementing component rather than a specific client role.
- architectural ruleAn architectural rule is a constraint that specifies an allowed or required structural property of a software system.
- query busA query bus dispatches query requests to their corresponding handlers through a single entry point.
- handler registryA mapping from operation types or other keys to the handlers responsible for processing them.
- error typeAn error represented by a distinct type so that its category and handling behavior are explicit.
- read modelA model optimized for retrieving and presenting selected application data rather than enforcing domain behavior.
- persistence entityAn object representing data in the form and structure required by a persistence mechanism.
- domain layerA software layer that contains business concepts, rules, and behavior independently of infrastructure frameworks.
- aggregate rootThe entity at the head of an aggregate that owns its consistency boundary and controls state changes within it.
- validatethencreateA construction pattern that validates all required constraints before creating an object and returns validation errors instead of an invalid object.
- factA statement of something that has happened, which other components may react to later.
- validation resultValidation is a Vavr value type for applicatively accumulating validation errors or producing a valid value.
- syntax validationValidation that checks whether input has the required presence and format without evaluating its business meaning.
- coordinatorA software component that coordinates interactions among other components or processes.
- dependency injectionDependency injection is a design technique in which an object's dependencies are supplied by external configuration or infrastructure.
- circuit breaker patternA resilience pattern that temporarily blocks calls to an unresponsive dependency and permits limited probes to determine when it has recovered.
- graceful failureA pattern in which a system returns reduced functionality or results when a dependency is unavailable while preserving required behavior and invariants.
- component scanningA Spring mechanism that scans specified packages for eligible classes and registers them as application-context beans.
- assembly moduleAn assembly module wires application components and adapters into a runnable application.
- integration testA test that verifies interactions between multiple application components or an application and an external system.
- persistence modelA persistence model is a representation of data shaped for storage and retrieval by a persistence mechanism.
- command handlerA command handler processes a command representing an application state change.
- architectural test freezingA mechanism that records existing architectural rule violations so they can be tolerated while new violations remain disallowed.
- driven actorAn external system that an application calls or otherwise causes to act during an interaction.
- driver actorAn external system or user that initiates an interaction by calling into an application.
- accidental complexityThe additional difficulty and disorder introduced by design choices, implementation shortcuts, and unnecessary coupling rather than by the problem domain itself.
- reconstitutionThe reconstruction of a previously persisted domain object from its stored state.
- Interface Segregation PrincipleThe Interface Segregation Principle states that clients should not be forced to depend on interface operations they do not use.
- dual-write problemThe dual-write problem is the consistency failure that occurs when one operation must atomically update a database and publish a message through separate systems.
- Transactional annotationSpring's @Transactional annotation declares transactional behavior for a class or method.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
