Architecture Boundaries

Layered, hexagonal, clean and onion compared honestly — plus adapters and anti-corruption layers, which are the part that survives whichever style you pick.

Architecture Boundaries

Domain, application, infrastructure and transport is a useful model of where the seams fall inside a codebase. It is one model, not universal truth, and saying so is the lesson.

Q · Where should the boundaries inside a single codebase fall, and does the four-role model actually answer that?
Hexagonal Architecture (Ports and Adapters)

An application core that declares the interfaces it needs, and adapters on the outside that satisfy them. An ordinary dependency-direction choice, worth its cost exactly where the outside varies.

Q · When does inverting a dependency into a port-and-adapter pair actually pay for the interface it costs?
Clean Architecture, and Where It Is Overused

Policy inward, details outward. One approach among several — and the one most often adopted whole, at a ceremony cost nobody prices before committing.

Q · What does "policy inward, details outward" actually buy, and when is the ceremony it charges not repaid?
Onion Architecture

Concentric rings with the domain model at the centre. Nearly the same idea as hexagonal and Clean, drawn differently — and saying so is more useful than pretending they are three schools.

Q · Are hexagonal, Clean and onion three different architectures, or one idea with three diagrams?
Boundary Adapters

Translate external formats into your own model at the edge, once. The rule that keeps a vendor SDK's types from spreading through code that has nothing to do with the vendor.

Q · Where should an external system's data stop being the external system's data and start being ours?
Anti-Corruption Layer

When the other system's concepts are wrong for you — not just its formats — translate the model, not the fields. The layer exists so their vocabulary cannot colonise yours.

Q · What do I do when integrating a system whose model of the domain genuinely conflicts with mine?