C
CIOPages
Back to Glossary

Architecture Patterns

Onion Architecture

Onion Architecture is a software design pattern proposed by Jeffrey Palermo that builds on hexagonal and clean architecture concepts, organizing code into concentric layers with the domain model at the center, surrounded by domain services, application services, and infrastructure—with all dependencies pointing inward toward the domain core.

Context for Technology Leaders

For CIOs, Onion Architecture provides a clear structural model for enterprise applications that need to maintain business logic integrity over long lifespans while adapting to changing technology infrastructure. Enterprise architects apply Onion Architecture when designing domain-rich enterprise systems.

Key Principles

  • 1Domain Model Core: The innermost layer contains the domain model—entities, value objects, and domain events—with zero dependencies on external concerns.
  • 2Domain Services: Business logic that doesn't naturally fit within a single entity resides in domain services, which depend only on the domain model.
  • 3Application Services: Application services orchestrate use cases by coordinating domain services and defining transaction boundaries, depending on domain but not infrastructure.
  • 4Infrastructure at the Edge: All infrastructure concerns—database access, API clients, messaging—reside in the outermost layer and depend inward on application interfaces.

Strategic Implications for CIOs

Enterprise architects should apply Onion Architecture for enterprise systems where domain complexity warrants the structural investment and where long-term maintainability is a priority over initial development speed.

Common Misconception

A common misconception is that Onion, Hexagonal, and Clean Architectures are fundamentally different approaches. They share the same core principle—dependency inversion with domain at the center—and differ primarily in terminology and layer naming. The key insight across all three is protecting business logic from infrastructure dependencies.

Related Terms