
Clean Coder Blog

By the same token, data formats used in an outer circle should not be used by an inner circle, especially if those formats are generate by a framework in an outer circle. We don’t want anything in an outer circle to impact the inner circles.
Robert C. Martin (Uncle Bob) • Clean Coder Blog
The software in this layer is a set of adapters that convert data from the format most convenient for the use cases and entities, to the format most convenient for some external agency such as the Database or the Web. It is this layer, for example, that will wholly contain the MVC architecture of a GUI. The Presenters, Views, and Controllers all... See more
Robert C. Martin (Uncle Bob) • Clean Coder Blog
this could literally be a convex function
Source code dependencies always point inwards. As you move inwards the level of abstraction increases. The outermost circle is low level concrete detail. As you move inwards the software grows more abstract, and encapsulates higher level policies. The inner most circle is the most general.
Robert C. Martin (Uncle Bob) • Clean Coder Blog
Conforming to these simple rules is not hard, and will save you a lot of headaches going forward. By separating the software into layers, and conforming to The Dependency Rule , you will create a system that is intrinsically testable, with all the benefits that implies.
Robert C. Martin (Uncle Bob) • Clean Coder Blog
Dependency rule: as you you go into circle, abstraction level increases and nothing in inner circle knows about outer circle
These use cases orchestrate the flow of data to and from the entities, and direct those entities to use their enterprise wide business rules to achieve the goals of the use case.
Robert C. Martin (Uncle Bob) • Clean Coder Blog
use case: what it is exactly the app does, for 42-speaks: giving feedback, conversing with the user about their day and shit, authenticating the user
Entities encapsulate Enterprise wide business rules. An entity can be an object with methods, or it can be a set of data structures and functions. It doesn’t matter so long as the entities could be used by many different applications in the enterprise.
If you don’t have an enterprise, and are just writing a single application, then these entities... See more
If you don’t have an enterprise, and are just writing a single application, then these entities... See more
Robert C. Martin (Uncle Bob) • Clean Coder Blog
entities: the nouns of the applications and the rules (literally) that govern them
nouns: a user, a practice session, feedback.
rules: a user must have an email to access a session,
a feedback must be linked to a session.
a database schema enforcing one of these is not enough the object with methods must enforce it
The concentric circles represent different areas of software. In general, the further in you go, the higher level the software becomes. The outer circles are mechanisms. The inner circles are policies.
Clean Coder Blog
They all have the same objective, which is the separation of concerns
Robert C. Martin (Uncle Bob) • Clean Coder Blog
If you don’t have an enterprise, and are just writing a single application, then these entities are the business objects of the application. They encapsulate the most general and high-level rules. They are the least likely to change when something external changes.