Clean Architecture
Robert C. Martin coined the term “Clean Architecture” in his book with the same name.3 In a Clean Architecture, in his opinion, the business rules are testable by design and independent of frameworks, databases, UI technologies, and other external applications or interfaces.
3 Clean Architecture by Robert C. Martin, Prentice Hall, 2017, Chapter 22.
This means that the domain code must not have any outward-facing dependencies. Instead, with the help of the DIP, all dependencies point toward the domain code.
Figure 3.3 shows what such an architecture might look like on an abstract level.
Figure 3.3 – In a Clean Architecture, all dependencies point inward toward the domain logic (Source: Clean Architecture by Robert C. Martin)
The layers in this architecture are wrapped around each other in concentric circles. The main rule in such an architecture is the “Dependency Rule,” which states...