<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/domain-centric-why-hexagonal--and-onion-architecture-are-answers-to-the-wrong-question-spring-i-o-irpxi7rvm" -->

---
title: Domain-centric? Why Hexagonal- and Onion-Architecture...
description: A Spring engineering team member argues that hexagonal and onion architectures are not truly domain-centric, since they focus attention on technical...
canonical: https://daily.dev/posts/domain-centric-why-hexagonal--and-onion-architecture-are-answers-to-the-wrong-question-spring-i-o-irpxi7rvm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Domain-centric? Why Hexagonal- and Onion-Architecture are answers to the wrong question @ Spring I/O | daily.dev
og:description: A Spring engineering team member argues that hexagonal and onion architectures are not truly domain-centric, since they focus attention on technical...
og:url: https://daily.dev/posts/domain-centric-why-hexagonal--and-onion-architecture-are-answers-to-the-wrong-question-spring-i-o-irpxi7rvm
og:image: https://api.daily.dev/og/posts/IrpXi7rvm.png
og:image:alt: Domain-centric? Why Hexagonal- and Onion-Architecture are answers to the wrong question @ Spring I/O
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Domain-centric? Why Hexagonal- and Onion-Architecture are answers to the wrong question @ Spring I/O

**[Spring I/O](https://daily.dev/sources/springio)** · 51 min read · 0 upvotes · 0 comments

## Summary

A Spring engineering team member argues that hexagonal and onion architectures are not truly domain-centric, since they focus attention on technical decomposition (ports, adapters, layers) rather than functional decomposition of the domain itself. Drawing on the concept that software cost equals coupling cost, and that good design means creating cohesive elements that are loosely coupled, the talk contends these popular architectures are essentially relabeled layered architecture with one dependency arrow reversed. The speaker advocates starting with functional slices (feature-based packages) rather than technical layers, applying technical decomposition (interfaces, ports) only when complexity demands it, and demonstrates the jMolecules library plus Spring Tools IDE integration for visualizing architectural stereotypes like aggregate roots and adapters directly in the IDE. A Q&A covers bounded contexts vs modules, microservices vs modules, Gradle multi-module setups, and criticizes the frontend/backend team split.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=YgIoITZpiP4>

## Questions this post answers

### What's the actual difference between hexagonal architecture and onion architecture?

Both are essentially altered forms of layered architecture with one key change: the dependency arrow between business logic and persistence is reversed, and dedicated interfaces (ports) are introduced on the business logic. Hexagonal architecture, from Alistair Cockburn in 2005, distinguishes driving (inbound) and driven (outbound) adapters, while onion architecture, coined in 2008 by Jeffrey Palermo, does not make that distinction and treats infrastructure as one surrounding ring.

_Developers weighing architectural styles for a new service can compare tradeoffs like this on daily.dev._

### Why do developers say hexagonal and onion architecture aren't really domain-centric?

Placing the domain visually at the center of a diagram does not make an architecture domain-centric, since neither approach offers guidance on decomposing the domain itself into meaningful parts when a system has multiple domains. Alistair Cockburn's own book repeatedly states 'we don't have an opinion on that' regarding domain decomposition, meaning teams end up organizing code by technical concerns (adapters, ports) rather than by business functionality.

_Teams debating how to structure a growing codebase can dig into this reasoning on daily.dev._

### How does jMolecules help visualize domain-driven design concepts like aggregate roots in an IDE?

jMolecules provides JAR-based types and annotations (such as aggregate root stereotypes) that developers apply to classes, which Spring Tools-based IDEs (VS Code, Eclipse, with IntelliJ support planned) then read via an annotation processor to group code by architectural role rather than folder location. Developers can also define custom stereotypes, like a project-specific DTO interface, and the IDE will automatically fold matching classes into that grouping in its navigation tree.

_Developers exploring code navigation tools that reflect architecture, not just folders, can track updates like this on daily.dev._

## Similar posts on daily.dev

- [Why are we talking about architecture again?](https://daily.dev/posts/why-are-we-talking-about-architecture-again--qeiyintcw) · ITNEXT · 19 upvotes · 3 comments
- [Quarkus Insights \#248: Introduction to Domain-Driven Design and Hexagonal Architecture](https://daily.dev/posts/quarkus-insights-248-introduction-to-domain-driven-design-and-hexagonal-architecture-mqimdssyg) · Quarkus · 3 upvotes · 0 comments
- [Layered Architecture for Building Readable, Robust, and Extensible Apps](https://daily.dev/posts/layered-architecture-for-building-readable-robust-and-extensible-apps-ca78tav68) · Towards Data Science · 0 upvotes · 0 comments
- [Quarkus Insights \#254: Domain-Driven Design and Hexagonal Architecture - Part 2](https://daily.dev/posts/quarkus-insights-254-domain-driven-design-and-hexagonal-architecture---part-2-l0ys2wwrx) · Quarkus · 1 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#spring](https://daily.dev/tags/spring), [#domain-driven-design](https://daily.dev/tags/domain-driven-design)

[View this post on daily.dev](https://daily.dev/posts/domain-centric-why-hexagonal--and-onion-architecture-are-answers-to-the-wrong-question-spring-i-o-irpxi7rvm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Domain-centric? Why Hexagonal- and Onion-Architecture are answers to the wrong question @ Spring I/O","url":"https://daily.dev/posts/domain-centric-why-hexagonal--and-onion-architecture-are-answers-to-the-wrong-question-spring-i-o-irpxi7rvm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/domain-centric-why-hexagonal--and-onion-architecture-are-answers-to-the-wrong-question-spring-i-o-irpxi7rvm"},"datePublished":"2026-09-27T07:26:28.705Z","dateModified":"2026-09-27T07:27:34.448Z","description":"A Spring engineering team member argues that hexagonal and onion architectures are not truly domain-centric, since they focus attention on technical...","image":"https://i.ytimg.com/vi/YgIoITZpiP4/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/YgIoITZpiP4/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Spring I/O","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Spring I/O","logo":"https://media.daily.dev/image/upload/s--e-TcwM9B--/f_auto,q_auto/v1790493985/logos/springio?_a=BAMAMicg0","url":"https://daily.dev/sources/springio"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/domain-centric-why-hexagonal--and-onion-architecture-are-answers-to-the-wrong-question-spring-i-o-irpxi7rvm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,spring,domain-driven-design","timeRequired":"PT51M","video":{"@type":"VideoObject","name":"Domain-centric? Why Hexagonal- and Onion-Architecture are answers to the wrong question @ Spring I/O","description":"A Spring engineering team member argues that hexagonal and onion architectures are not truly domain-centric, since they focus attention on technical...","thumbnailUrl":"https://i.ytimg.com/vi/YgIoITZpiP4/sddefault.jpg","uploadDate":"2026-09-27T07:26:28.705Z","duration":"PT51M","url":"https://api.daily.dev/r/IrpXi7rvm","embedUrl":"https://www.youtube.com/embed/YgIoITZpiP4"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Spring I/O","item":"https://daily.dev/sources/springio"},{"@type":"ListItem","position":3,"name":"Domain-centric? Why Hexagonal- and Onion-Architecture are answers to the wrong question @ Spring I/O"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/domain-centric-why-hexagonal--and-onion-architecture-are-answers-to-the-wrong-question-spring-i-o-irpxi7rvm#faq","mainEntity":[{"@type":"Question","name":"What's the actual difference between hexagonal architecture and onion architecture?","acceptedAnswer":{"@type":"Answer","text":"Both are essentially altered forms of layered architecture with one key change: the dependency arrow between business logic and persistence is reversed, and dedicated interfaces (ports) are introduced on the business logic. Hexagonal architecture, from Alistair Cockburn in 2005, distinguishes driving (inbound) and driven (outbound) adapters, while onion architecture, coined in 2008 by Jeffrey Palermo, does not make that distinction and treats infrastructure as one surrounding ring. Developers weighing architectural styles for a new service can compare tradeoffs like this on daily.dev."}},{"@type":"Question","name":"Why do developers say hexagonal and onion architecture aren't really domain-centric?","acceptedAnswer":{"@type":"Answer","text":"Placing the domain visually at the center of a diagram does not make an architecture domain-centric, since neither approach offers guidance on decomposing the domain itself into meaningful parts when a system has multiple domains. Alistair Cockburn's own book repeatedly states 'we don't have an opinion on that' regarding domain decomposition, meaning teams end up organizing code by technical concerns (adapters, ports) rather than by business functionality. Teams debating how to structure a growing codebase can dig into this reasoning on daily.dev."}},{"@type":"Question","name":"How does jMolecules help visualize domain-driven design concepts like aggregate roots in an IDE?","acceptedAnswer":{"@type":"Answer","text":"jMolecules provides JAR-based types and annotations (such as aggregate root stereotypes) that developers apply to classes, which Spring Tools-based IDEs (VS Code, Eclipse, with IntelliJ support planned) then read via an annotation processor to group code by architectural role rather than folder location. Developers can also define custom stereotypes, like a project-specific DTO interface, and the IDE will automatically fold matching classes into that grouping in its navigation tree. Developers exploring code navigation tools that reflect architecture, not just folders, can track updates like this on daily.dev."}}]}
```

