via The Clean Architecture | 8th Light by “Uncle” Bob Martin

The outer circles are mechanisms. The inner circles are policies.

The overriding rule that makes this architecture work is The Dependency Rule . This rule says that source code dependencies can only point inwards .

  1. Entities
  2. Use Cases
  3. Adapters (Controllers, Gateways, Presenters)
  4. Frameworks

Only Four Circles?

No, the circles are schematic. You may find that you need more than just these four. There’s no rule that says you must always have just these four.

What data crosses the boundaries.

Typically the data that crosses the boundaries is simple data structures.

So when we pass data across a boundary, it is always in the form that is most convenient for the inner circle.

See also “I’ve noticed a surprising resistance to the idea. Apparently the notion that it’s a good idea to hide the framework, UI, or database from the application code is not universally accepted.

**Update 2013-11-11:
** See also this interesting series of posts about application architecture, with illustrative examples in PHP: OOP Business Applications — Whitewashing

  1. Trying to escape the mess
  2. Entity, Boundary, Interactor (EBI)
  3. Data, Context, Interaction (DCI)
  4. Command-Query-Responsibility-Segregation (CQRS)