Manning Early Access Program (MEAP)
Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
Modern architectural styles like “hexagonal,” “clean,” and “onion” all share a straightforward principle: business logic should sit at the center of your software, free of frameworks, databases, user interfaces, and external services. The tricky bit comes when you start putting these ideas into practice when you’re refactoring a legacy enterprise mudball, implementing microservices, or building a “modulith” in Spring. Decoupling by Design: Clean architecture for maintainable applications guides you from the hexagonal architecture at the core of modern enterprise software to its practical implementation with examples in Java and Spring Boot.
If you’ve ever stared at a class and asked “where does this code belong?” this book ends the guesswork. Author Enrique Medina Montenegro shows you how to take advantage of an architecture that gives every class exactly one reason to exist and one place to live. Following the principles of hexagonal architecture, you’ll build a running example application outward from the domain core. Each chapter adds a new layer, until the architecture enforces itself through executable specifications.
The book begins with the pain points that push teams toward clean architecture. Then, it introduces the hexagon and the dependency inversion mechanics behind it. Next, you’ll learn to handle input ports, an orchestrating application layer, a domain layer with enforced invariants, and output ports to infrastructure. Finally, you’ll assemble the full structure, then lock it down with ArchUnit rules (including freeze for legacy adoption) and mechanical unit testing recipes. In part two, you’ll extend this foundation into modular monoliths and microservice extraction.
By the time you’re done reading, you’ll have built a complete hexagonal application from the domain core outward, and gained the discipline to apply the same patterns to any codebase you touch next. You’ll know exactly where every class belongs, why every dependency points inward, and how to write tests that stay green when infrastructure changes. Most importantly, you’ll have the confidence to push back on tangled dependencies, leaky abstractions, and framework lock-in, because you’ll have seen what clean architecture looks like when it’s done right.
what's inside
Build the WriteFlow app from the domain core outward
Master input ports, output ports, and command/query buses
Enforce architecture automatically with ArchUnit rules
Apply mechanical testing recipes with JUnit 5, Mockito, and AssertJ
Scale into modular monoliths and microservices
about the reader
For intermediate to senior developers, software architects, and technical leads who want to turn clean architecture theory into production-ready code. The examples are in Java, but can be applied to any language.
about the author
Enrique Medina Montenegro is a Senior Solution Architect and Technical Leader who has been delivering successful distributed applications in several sectors for over 25 years. He has over 20 years of Java experience.
Introductory offer Save 50% for a limited time!
eBook
pdf, ePub, online
$55.99
$27.99
you save $28.00 (50%)
Introductory offer Save 50% for a limited time!
print
includes eBook
$69.99
$34.99
you save $35.00 (50%)
with subscription
free or 50% off
$24.99
pro $24.99 per month
access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!