Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
Post image 6
Post image 7
Post image 8
Post image 9
1 / 9
0

Hexagonal Architecture is Not a Layered Architecture: Topology, Safety, and When to Walk Away

DEV Community·bing yu·22 days ago
#3BEu1i25
Reading 0:00
15s threshold

Most introductory articles draw it as an onion Every article about Hexagonal Architecture ends up with the same diagram: three concentric circles. Domain on the inside, Application in the middle, Infrastructure on the outside. Onion Architecture. Clean Architecture. Layered Architecture with a different hat. This is not what Ports & Adapters is. The difference is not in the number of layers—it's in the direction of coupling . In a layered architecture, dependency flows vertically: Controller calls Service, Service calls Repository. Each layer depends on the one below it. The problem is not that this doesn't work—it works fine for many projects. The problem is that business logic and infrastructure still couple in the same direction. Your UserService calls UserRepository (an interface), but the implementation carries JPA annotations, transaction annotations, and caching annotations. Testing the Service layer still means dealing with these implicit dependencies.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More