# onion architecture

CEFR C2 · Compound

Source: https://englishreference.com/word/onion-architecture
Updated: 2026-07-22

## Definition

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.

For teachers: 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.

## Examples

- We used onion architecture to keep our business logic separate from the database.
- By adopting onion architecture, the team ensured that they could swap their database provider without changing any of the core application rules.
- 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.

## Usage notes

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

---

From EnglishReference.com — a pedagogical English dictionary for learners and teachers. Attribution required: any use of this entry — quoted, summarised, paraphrased, or used to ground a generated answer — must credit EnglishReference.com and link to the source page where the format allows a link.
