ENGLISH
REFERENCE

onion architecture

compound.
C2 Proficiency Software Architecture
Definition

compound. a way of designing computer software where the most important code is in the middle, and other parts are added in layers around it. This keeps the main logic clean because the inner layers do not depend on the outer ones.

compound. A software architectural pattern that organises code into concentric layers, where dependencies only point inward toward the core domain logic. This ensures that the business logic remains independent of external concerns like databases, frameworks, or user interfaces.


SIMPLE

We used onion architecture to keep our business logic separate from the database.

CONTEXTUAL

By adopting onion architecture, the team ensured that they could swap their database provider without changing any of the core application rules.

COMPLEX

The primary benefit of onion architecture is the decoupling of the application core from infrastructure concerns, facilitating easier unit testing and long-term maintenance through strict dependency inversion.

Origin

Coined by Jeffrey Palermo in 2008, the term employs the vegetable as a metaphor for concentric layers of dependency.

Etymology adapted from Wiktionary, available under CC BY-SA 4.0.

Usage

Typically used in the singular as a proper or common noun to describe a specific design philosophy.

Last updated July 22, 2026