Comparison
Clean architecturevsLayered architecture
Clean architecture
entities, then use cases, then adapters, then frameworks — and nothing in an inner circle names anything outside it.
Martin's synthesis of hexagonal, onion and several older layered schemes into concentric circles governed by the dependency rule. Its distinctive contributions are the naming of use case interactors as a layer of their own and the insistence that frameworks are a detail at the outermost ring. In practice it and hexagonal architecture describe the same system, and arguing about which one a codebase follows is rarely a productive hour.
Full entry →Layered architecture
the controller called the database directly and three people commented on the pull request.
Arranging code so that each layer may only call the one beneath it — typically interface, application, domain, infrastructure. It gives you a rule that can be checked rather than an aesthetic, which is why layering violations are one of the few design arguments a linter can settle. Layers stop paying when they become pass-through: four layers that each rename a field are ceremony, not structure.
Full entry →