Layers (inner to outer)
- Entities — enterprise business rules. Depend on nothing
- Use Cases — application business rules. Depend only on Entities
- Interface Adapters — Controllers, Presenters, Gateways. Transform data formats between Use Cases and the outside world
- Frameworks & Drivers — DB, Web, UI. The outermost layer
The dependency rule
Code in an inner layer never mentions anything from an outer one. Dependency is injected through an interface.
Related concepts
Hexagonal Architecture (Ports & Adapters), Onion Architecture — different names for the same idea: shield domain logic from infrastructure.