Clean Architecture
A software architecture pattern that emphasizes separation of concerns through concentric layers with dependencies pointing inward.
Also known as: Onion Architecture, Hexagonal Architecture, Ports and Adapters
Category: Software Development
Tags: architecture, software-design, software-engineering, best-practices, patterns
Explanation
Clean Architecture is a software design philosophy proposed by Robert C. Martin (Uncle Bob) that emphasizes separation of concerns through layered architecture. The core principle is the Dependency Rule: source code dependencies must point inward, toward higher-level policies. Layers from outside to inside: (1) Frameworks & Drivers - UI, database, web frameworks, (2) Interface Adapters - controllers, presenters, gateways, (3) Application Business Rules - use cases, (4) Enterprise Business Rules - entities. Benefits include: independence from frameworks, testability, independence from UI, independence from database, and independence from external agencies. The architecture enables: easier testing through dependency injection, flexibility to swap components, and protection of business logic from external changes. Related patterns include Hexagonal Architecture (Ports and Adapters), Onion Architecture, and the principles overlap significantly with Domain-Driven Design.
Related Concepts
← Back to all concepts