Layers
Clean Architecture has four layers:
- Frameworks and Drivers (blue): UI, External Interfaces, DB, Devices
- Interface Adapters (green): Gateways, Controllers, Presenters
- Application Business Rules (red): Use Caes
- Enterprise Business Rules (yellow): Entities
Example
Dependency Direction
No impacts from outer circles to inner circles!
Inner Layers do not know anything about outer layers.
Benefits:
- Use advantages of frameworks with less of their disadvantages
- Business rules testable without external elements
- Change UI without changing rest of system
- Business rules are not bound to any DB vendor
- Business rules do not know (and are independent of) the outside world