Onion Architecture

framework · computer science · organizing-schema

Concentric layers with dependencies pointing inward toward the domain core.

Onion Architecture was articulated by Jeffrey Palermo in a series of 2008 blog posts, building on Hexagonal Architecture's core insight while presenting it as concentric layers — the domain model at the center, surrounded by domain services, then application services, then infrastructure and UI at the outer edges. The defining rule is the Dependency Rule: source code dependencies can point only inward (an outer layer can depend on an inner layer, but never the reverse), with the practical implementation using dependency inversion (interfaces defined in inner layers, implementations in outer layers). The concentric structure was Palermo's pedagogical contribution — making the inward dependency direction visually obvious. Onion sits between Hexagonal Architecture's ports-and-adapters framing and Clean Architecture's later synthesis, with the three patterns sharing the same fundamental dependency-inversion principle while differing in vocabulary, diagramming, and emphasis. Onion was particularly influential in the .NET community where Palermo was active.

Originators

Jeffrey Palermo high

Year / Decade

2008 (Palermo blog posts: 'The Onion Architecture: Part 1, 2, 3, 4') high

Primary sources

Palermo, J. (2008). 'The Onion Architecture: Part 1, 2, 3, 4' (jeffreypalermo.com) high

Core components

Primary use case

Application architecture, particularly in .NET and adjacent ecosystems; alternative diagramming for the same dependency-inversion principles as Hexagonal Architecture; teaching framework for layered architecture done right; common reference in enterprise application architecture discussions.

Common criticisms

Lineage

Parent of
Clean Architecture
Child of
Hexagonal Architecture
Siblings
Hexagonal Architecture, Clean Architecture
Derived from
Hexagonal Architecture