👨‍💻
Software Engineering
Clean Architecture
Clean Architecture
  • Overview
  • Foreword
  • Preface
  • Part 1
    • Introduction
    • 1: Design & Architecture
    • 2: A Tale of Two Values
  • Part 2: Programming Paradigms
    • 3: Paradigm Overview
    • 4: Structured Programming
    • 5: Object-Oriented Programming
    • 6: Functional Programming
  • Part 3: Design Principles
    • Intro
    • 7: Single Responsibility Principle
    • 8: Open-Closed Principle
  • Part 5: Architecture
    • 22: Clean Architecture
Powered by GitBook
On this page
  • Similar Architectures
  • Entities
  • Use Cases
  • Interface Adapters
  1. Part 5: Architecture

22: Clean Architecture

Previous8: Open-Closed Principle

Last updated 11 months ago

Similar Architectures

  • Hexagonal Architecture (Ports & Adapters)

  • DCI

  • BCE

They all have the same objective:

  • The separation of concerns achieved by dividing the software into layers.

Each architecture produces a system with the following characteristics:

  • Independent of Frameworks

  • Testable

  • Independent of the UI

  • Independent of the database

  • Independent of any external agency.

Entities

  • Encapsulate enterprise-wide (or domain) Critical Business Rules.

  • Can be an object with methods, or it can be a set of data structures and functions.

  • Can be used by many different applications.

  • Business Objects of the Application/Domain.

  • Encapsulate the most general, high-level rules.

  • Least likely to change when something external happens.

Use Cases

  • Layer contains Application-specific business rules.

  • Use cases orchestrate the flow of data to and from the entities, and direct those entities to use their Critical Business Rules to achieve the goals of the Use Case.

  • We do NOT expect....

    • Changes in this layer to affect the Entities.

    • This layer to be affected by changes to externalities such as the database, the UI, or any of the common frameworks.

  • Changes to the operation of the application will affect the use cases and software in this layer.

Interface Adapters

  • A set of adapters that convert data from the format most convenient for the user cases and entities, to the format convenient for some external agency (database or web).

  • Also in this layer is any adapter necessary to convert data from some external form (external service) to the internal form used by the use cases and entities.

Clean Coder Blog
Clean Architecture Blog
Logo