Robert C. Martin
Clean Architecture
Robert C. Martin on keeping the rules of a system independent from screens, databases and frameworks, so that the details can change.
The argument. Source-code dependencies should point toward policy, the rules of the business, and away from detail: the interface, the database, the framework, the devices. The core must not know how it is shown or stored, and the details plug into it. A system built that way can swap its details, and its rules can be tested without them.
Ideas worth keeping
- The dependency rule. Inner parts never name outer ones.
- Boundaries by interface. Put an interface where the inner side needs something, and implement it outside.
- The humble object. Keep the hard-to-test edge, such as a window, so thin that there is almost nothing to test.
- Details are late decisions. Frameworks, storage and delivery are plug-ins.
- Screaming architecture. The folder layout should say what the system is for, not which framework it uses.
Where it shows in Classroom Manager
The protocol library knows nothing about the teacher’s window or the student service, and the code that decides what to do is kept apart from the code that touches Windows. That is why most of the decision logic has automated tests, even though the program itself is a Windows desktop application.
Who should read it
Developers deciding how to structure a growing application, and technical leads who want to keep options open.
Find the book (Open Library) ↗ (opens in a new tab)
Notice: the title, the author's name and any related marks, names and trade dress of the book discussed on this page are the property of their respective owners and are referred to for the purposes of identification, criticism and review only. Dausuva is not affiliated with, sponsored by or endorsed by the author or the publisher. The summary above is original text written by Dausuva, does not reproduce the book, and does not replace it. All rights in the book are reserved by their respective owners.