Clean Architecture
Clean Architecture organizes software so that business rules sit at the center, independent of frameworks, databases, and delivery mechanisms. Dependencies point inward, making the core logic testable and replaceable without rewriting the surrounding infrastructure.
itSoftware engineering | OpenSkills.info
Intro
Clean Architecture
Clean Architecture keeps business rules separate from delivery and infrastructure details. Your application still uses a web framework, database, message broker, or command line. Those tools sit outside the policy that defines what the application does.
The central idea is a direction rule. Source code dependencies point toward business policy. Inner code does not name outer tools. Outer code translates between a tool's format and the application's own models.
This structure gives you options. You can test business behavior without starting a web server or connecting to a production database. You can replace a user interface or persistence mechanism without rewriting the core rules. The architecture does not remove change. It limits how far a change can spread.
Why boundaries matter
Applications often begin with a framework-generated structure. Controllers receive requests. Data-access objects store records. Business decisions then slip into both places because they are convenient.
That arrangement works until one decision must serve another interface or use another storage mechanism. The same rule gets copied, or the new interface must call through the old delivery path. Tests also inherit setup that has nothing to do with the rule under test.
Clean Architecture draws explicit boundaries around policy. A boundary controls which concepts cross and which direction the code knows about. It separates reasons to change:
- Business rules change when the organization changes its policy.
- Application rules change when a use case changes.
- Interface adapters change when an external format changes.
- Frameworks and drivers change when a technical product changes.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
Supports
- Separation of concerns, framework independence, testability, and independence from user interface, database, and external agencies
- The Dependency Rule, entities, use cases, interface adapters, frameworks and drivers, and boundary crossing through dependency inversion
- https://blog.cleancoder.com/uncle-bob/2011/11/22/Clean-Architecture.html
Supports
- Controller, interactor, presenter, and simple boundary-data flow
- Testing application policy without a web server, container, or user interface
- https://alistair.cockburn.us/hexagonal-architecture
Supports
- Original Ports and Adapters intent, terminology, inside-outside boundary, and multiple adapters per port
- Isolation from user-interface and database technology for testing and alternate application drivers
- https://blog.cleancoder.com/uncle-bob/2011/09/30/Screaming-Architecture.html
Supports
- Organizing architecture around use cases and business purpose instead of frameworks
- Deferring choices about frameworks, databases, web servers, and delivery mechanisms
- https://martinfowler.com/bliki/PresentationDomainDataLayering.html
Supports
- Logical layers as modules rather than physical tiers
- Domain independence from data sources, layering granularity, and domain-oriented modules for larger applications
- https://martinfowler.com/eaaCatalog/dataMapper.html
Supports
- Mapping between in-memory objects and database data while isolating both representations
- Keeping domain code unaware of database schema and mapping machinery
- https://www.pearson.com/en-us/subject-catalog/p/clean-architecture-a-craftsmans-guide-to-software-structure-and-design/P200000009528/9780134494326
Supports
- Book authorship, publication identity, scope, and official table of contents
- Coverage of design principles, components, boundaries, business rules, testing, frameworks, databases, and case studies
