---
title: "Onion Architecture"
section: "concepts"
type: "concept"
created: "2026-08-25"
updated: "2026-08-25"
tags: ["principle", "workflow"]
canonical: "https://pyweb.dev/wiki/onion-architecture"
---
# Onion Architecture

An architectural pattern created by [jeffrey palermo](/wiki/jeffrey-palermo) that organizes software into concentric layers with dependencies pointing inward toward the core domain. This pattern directly influenced [clean architecture](/wiki/clean-architecture)'s layered approach and emphasis on the [dependency rule](/wiki/dependency-rule).

## Core Principle

Like an onion's layers, the architecture consists of concentric circles where:
- **Inner layers contain policies** — business rules and domain logic
- **Outer layers contain mechanisms** — infrastructure and implementation details  
- **Dependencies point inward** — outer layers depend on inner layers, never vice versa

## Influence on Clean Architecture

[robert c martin](/wiki/robert-c-martin)'s [clean architecture](/wiki/clean-architecture) synthesis adopted the onion pattern's:
- **Concentric organization** — the four-circle clean architecture structure
- **Inward dependencies** — became the core [dependency rule](/wiki/dependency-rule)
- **Domain protection** — business rules isolated from external changes

The onion pattern established the conceptual foundation for dependency inversion in layered architectures.

 [[source: uncle-bob-clean-architecture-2012]](/wiki/raw/articles/uncle-bob-clean-architecture-2012)

---

## Agent Navigation

cluster: person (170 pages) | betweenness: 0.3

### References (outbound)
- [Jeffrey Palermo](https://pyweb.dev/wiki/jeffrey-palermo.md)
- [Robert C. Martin (Uncle Bob)](https://pyweb.dev/wiki/robert-c-martin.md)
- [Dependency Rule](https://pyweb.dev/wiki/dependency-rule.md)

### Referenced by (inbound)
- [Clean Architecture](https://pyweb.dev/wiki/clean-architecture.md)
- [Jeffrey Palermo](https://pyweb.dev/wiki/jeffrey-palermo.md)

### Evidence (verified primary sources)
- [uncle-bob-clean-architecture-2012](https://pyweb.dev/wiki/raw/articles/uncle-bob-clean-architecture-2012.md) | origin: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html | ingested: 2026-08-25 | sha256: b99ae450b5981dbee264aec42701b920ce96ccedea01d03243ea48c414442379

### Machine endpoints
- Knowledge graph: https://pyweb.dev/api/graph.json
- Graph analysis: https://pyweb.dev/api/graph-analysis.json
- Context index: https://pyweb.dev/llms.txt
