Hexagonal, Onion, Vertical Slice — Same Forces, Different Projections
Why architectural styles are perspectives, not religions
Architectures are not competing truths.
They are different projections of the same forces.
This is Part 9 of the series:
- Classes in C#: From First Principles to Architectural Mastery
- Abstract Class vs Interface — A Systems View
- Composition vs Inheritance — The Physics of Change
- Encapsulation & Information Hiding — Designing for Ignorance
- SOLID Revisited — A Post-Pattern Perspective
- Polymorphism — Substitution Over Reuse
- Clean Architecture as a Consequence, Not a Pattern
- When Not to Use OOP — The Cost of Abstraction
- Hexagonal, Onion, Vertical Slice — Same Forces, Different Projections
This article explains why these architectures feel different,
yet solve the same underlying problem.
The False Debate
Discussions often sound like:
- “Hexagonal is better than Clean”
- “Vertical Slice is more modern”
- “Onion is simpler”
These debates miss the point.
They argue over shapes, not forces.
Architecture as Projection
Imagine architecture as physics.
The system has:
- forces (change, volatility, coupling)
- constraints (teams, tools, time)
- invariants (business rules)
Architectural styles are coordinate systems —
ways of viewing the same reality.
Change the viewpoint.
The forces stay the same.
The Common Enemy: Volatile Detail
All three architectures exist to solve one problem:
How do we prevent volatile details from corrupting stable policy?
UI, databases, frameworks, protocols —
these change faster than business meaning.
Every style draws boundaries to contain that volatility.
Hexagonal Architecture (Ports & Adapters)
What it emphasizes
- Explicit boundaries
- Input/output symmetry
- Technology independence
[ Adapter ] ---> [ Port ] ---> [ Core ]
Strengths
- Clear integration points
- Excellent testability
- Framework isolation
Trade-offs
- Can feel abstract
- Overkill for simple apps
Hexagonal is best when integration complexity dominates.
Onion Architecture
What it emphasizes
- Domain purity
- Dependency direction
- Layered protection
UI -> Application -> Domain
Strengths
- Simple mental model
- Strong domain focus
- Natural fit for DDD-lite
Trade-offs
- Layer friction
- Temptation to add “pass-through” layers
Onion is best when domain complexity dominates.
Vertical Slice Architecture
What it emphasizes
- Feature cohesion
- Local reasoning
- Change isolation
Feature A
Feature B
Feature C
Each slice cuts vertically through all layers.
Strengths
- Minimal ceremony
- Fast change
- Reduced cross-feature coupling
Trade-offs
- Harder global consistency
- Requires discipline to avoid duplication
Vertical Slice shines when change frequency dominates.
Same Forces, Different Emphasis
| Force | Hexagonal | Onion | Vertical Slice |
|---|---|---|---|
| Volatility control | Ports | Layers | Feature isolation |
| Dependency direction | Inward | Inward | Localized |
| Change localization | Adapters | Layers | Slices |
| Primary driver | Integration | Domain | Features |
None of these cancel the others.
They rotate the same problem space.
Why Mature Systems Mix Styles
Real systems rarely use one style purely.
Common combinations:
- Onion core + Hexagonal adapters
- Vertical slices inside a Clean Architecture boundary
- Hexagonal ports grouped per slice
This is not inconsistency.
It is context sensitivity.
The Smell of Architectural Dogma
You’re probably doing it wrong if:
- style choice comes before problem understanding
- diagrams matter more than dependency direction
- refactoring feels dangerous
- adding a feature requires touching unrelated code
Architecture should reduce fear, not create it.
Choosing a Projection (A Practical Guide)
Ask:
- What changes most often?
- What must be protected?
- Where does complexity accumulate?
- How do teams work?
Then choose the projection that makes those forces visible.
The Mental Model to Keep
Architectures are lenses.
Forces are real.
Change the lens.
Don’t deny the forces.
Final Takeaway
Junior developers ask:
“Which architecture should we use?”
Senior engineers ask:
“Which forces do we need to see clearly?”
Answer that —
and the architecture will reveal itself.
✍️ Cristian Sifuentes
.NET / C# • Architecture • Systems Thinking
Style is optional.
Forces are not.

Top comments (0)