HOME TECH BLOGS COMPUTER ARCHITECTURE BOOKS ABOUT GITHUB

Clean Architecture

Clean Architecture - Cover

A Craftsman's Guide to Software Structure and Design

Robert C. Martin

Published: 2017

ChatGPT's summary

Genre: Software Design / Architecture / Programming Best Practices

Core Idea: Good architecture enables change. It should make the system easy to understand, develop, and maintain—now and in the future.


Main Premise:

Software architecture isn’t about specific frameworks or tools—it's about how components are organized and how dependencies are managed. Uncle Bob introduces principles that allow software systems to be flexible, maintainable, testable, and independent of frameworks, UI, databases, and external systems.


🧱 Core Concepts & Lessons

1. The Goal of Architecture


2. Separation of Concerns


3. The Clean Architecture (Onion/Circle Model)

At the center is your core business logic. Around it are layers of less-critical, more changeable components.

🧅 Layers:

  1. Entities – Business rules, enterprise logic, core data structures.
  2. Use Cases (Interactors) – Application-specific rules (e.g. user actions, workflows).
  3. Interface Adapters – Transforms data from the format your use cases need to the format your external systems (e.g. DB, web, UI) use.
  4. Frameworks & Drivers – UI, databases, external APIs, devices.

🧭 Rule: Dependencies always point inward—outer layers depend on inner layers, never the reverse.


4. The Dependency Rule

“Source code dependencies must point only inward, toward higher-level policies.”

This allows core logic to remain untouched even as external systems change (e.g. switching databases or UI frameworks).


5. The SOLID Principles

Uncle Bob recaps and reinforces the SOLID principles (covered in earlier works), emphasizing their role in achieving clean architecture:

These principles guide class design and system decomposition.


6. Frameworks Are Tools, Not Foundations


7. Databases Are Details


8. Use Cases Drive the System


🧾 Who Should Read This?


⚖️ Key Benefits of Clean Architecture


🔁 Comparison: Clean Code vs. Clean Architecture vs. The Clean Coder

Feature Clean Code The Clean Coder Clean Architecture
Focus How to write readable, maintainable code How to behave like a professional How to structure systems for longevity
Level Code-level (functions, classes) Team/process-level System-level (components, layers)
Main Concern Readability, simplicity Responsibility, discipline Modularity, testability, flexibility