DEV Community

Dominik Paszek
Dominik Paszek

Posted on

Hexagonal Architecture in Spring Boot — Win a Free Book

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 milliseconds 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 here: youtube link]


The contest

Fork the repo, refactor the user and order packages to Hexagonal Architecture, open a Merge Request, and drop the link in the YouTube comments.

Three things that make a valid submission: ports use business names (loadUser not findById), the domain package has zero Spring annotations, and at least one test runs without @SpringBootTest.

One random winner from all valid submissions gets the ebook.

Deadline: [02.04.2026]
Repo: GitLab link


Part of an ongoing Spring Boot + DDD series. Next up: Value Objects.

Top comments (0)