Hexagonal Architecture in Spring Boot — Win a Free Book
Source: Dev.to
We’re Running a Contest — Refactor to Hexagonal Architecture and Win a Book
I just published a full tutorial on Hexagonal Architecture in Spring Boot, and we’re running a contest alongside it.
The prize is “Get Your Hands Dirty on Clean Architecture” by Tom Hombergs as an ebook — the book that popularized this exact pattern in the Java world.
What the video covers
In Episode 1 of my Spring Boot series I showed a basic api/domain/infrastructure structure. This episode takes it further — proper Ports & Adapters, an explicit application layer, and the thing that makes it all worth it: business‑logic tests that run in 50 ms instead of 45 seconds.
The key insight the video builds toward: Spring’s dependency injection is already the hexagonal mechanism. When your controller injects RegisterUser and Spring provides RegisterUserService — that is ports and adapters. You just need to be intentional about which interfaces go where.
→ Watch the full episode on YouTube
The contest
- Fork the repo.
- Refactor the
userandorderpackages to Hexagonal Architecture. - Open a Merge Request and drop the link in the YouTube comments.
A valid submission must meet all of the following:
- Ports use business‑oriented names (e.g.,
loadUserinstead offindById). - The domain package contains zero Spring annotations.
- At least one test runs without
@SpringBootTest.
One random winner from all valid submissions receives the ebook.
Deadline
02 April 2026
Repository
GitLab – Hexagonal Architecture branch
Part of an ongoing Spring Boot + DDD series. Next up: Value Objects.