Book Image

Get Your Hands Dirty on Clean Architecture

By : Tom Hombergs
Book Image

Get Your Hands Dirty on Clean Architecture

By: Tom Hombergs

Overview of this book

Building for maintainability is key to keeping development costs low and processes easy. The second edition of Get Your Hands Dirty on Clean Architecture is here to equip you with the essential skills and knowledge to build maintainable software. With this comprehensive guide, you’ll explore the drawbacks of conventional layered architecture and the advantages of domain-centric styles such as Robert C. Martin's Clean Architecture and Alistair Cockburn's Hexagonal Architecture. Then, you’ll dive into hands-on explanations on how to convert hexagonal architecture into actual code. You'll learn in detail about different mapping strategies between the layers of hexagonal architecture and discover how to assemble the architectural elements into an application. Additionally, you’ll understand how to enforce architecture boundaries, which shortcuts produce what types of technical debt, and how, sometimes, it is a good idea to willingly take on those debts. By the end of this second edition, you'll be armed with a deep understanding of the hexagonal architecture style and be ready to create maintainable web applications that save money and time.
Table of Contents (13 chapters)

The Domain is King

It should have become obvious in the previous chapters that the main feature of a hexagonal architecture style is that we can develop the domain code free from diversions such as persistence concerns and dependencies upon external systems.

Evolving domain code free from external influence is the single most important argument for the hexagonal architecture style.

This is why this architecture style is such a good match for Domain-Driven Design (DDD) practices. To state the obvious, in DDD the domain drives the development. And we can best reason about the domain if we don't have to think about persistence concerns and other technical aspects at the same time.

I would even go so far as to say that domain-centric architecture styles such as the hexagonal style are enablers of DDD. Without an architecture that puts the domain into the center of things, without inverting the dependencies toward the domain code, we have no chance of really doing DDD; the design will always...