CL

Clean Architecture

Dependency inversion and use-case driven design

Details

Language / Topic
_UUniversal
Category
Architecture

Rules

balanced
- Separate code into layers: entities, use cases, adapters, and infrastructure.
- Dependencies point inward — infrastructure depends on domain, never the reverse.
- Entities and use cases must have zero dependencies on frameworks — only interface adapters and the outer layer reference external libraries.
- Define interfaces (ports) in the domain layer; implement them in infrastructure (adapters).
- Keep business rules framework-agnostic — no HTTP, database, or UI concerns in domain logic.