Hexagonal Architecture in Spring Boot — Win a Free Book

Published: (March 19, 2026 at 01:28 PM EDT)
2 min read
Source: Dev.to

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

  1. Fork the repo.
  2. Refactor the user and order packages to Hexagonal Architecture.
  3. 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., loadUser instead of findById).
  • 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.

0 views
Back to Blog

Related posts

Read more »

two sum- java

Solving Two Sum Using Hashing My Thought Process When I first saw the Two Sum problem, my initial idea was simple: - Target = 9 - Current number = 2 I don’t ne...