E-Book, Englisch, 322 Seiten
Colla / Acerbis / Yao Domain-Driven Refactoring
1. Auflage 2025
ISBN: 978-1-83588-911-4
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection
A hands-on DDD guide to transforming monoliths into modular systems and microservices
E-Book, Englisch, 322 Seiten
ISBN: 978-1-83588-911-4
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection
As software development continues to grow, mastering domain-driven design (DDD) will help transform your approach to complex systems. Filled with actionable insights and practical examples, this book is your essential guide to implementing DDD principles, covering its key concepts and practical applications in modern architecture.
Alessandro, an eCommerce specialist and DDD expert with 30 years of experience, and Alberto, a dedicated backend developer, tap into their extensive expertise to help you refactor your monolith into a modular structure, whether it be evolving into microservices or enhancing a maintainable monolith, resulting in a system that adapts to changing business needs and non-functional requirements.
You'll explore vital DDD patterns like strategic design with bounded contexts and ubiquitous language, improving communication between technical and domain experts. The chapters take you through modeling techniques to manage complexity and increase flexibility, while also addressing microservices integration, including inter-service communication, transaction management, and data strategies.
By the end of this book, you'll be able to decompose a monolith and refine its architecture for adaptability, all while ensuring business logic remains central to your software design and development.
Autoren/Hrsg.
Weitere Infos & Material
Preface
The software development domain is constantly evolving, driven by the increasing demands of businesses and the growing complexity of technological ecosystems. Applications must now adapt to distributed architectures, support rapid changes, and remain resilient under immense pressure—all while aligning closely with business goals. These challenges are both exciting and daunting, requiring developers and architects to think beyond code and embrace methodologies that bridge the gap between technical precision and business alignment.
Modern software development operates at a crossroads where business innovation and technical challenges intersect. As organizations grow and adapt, the demands on software systems build up. Legacy architectures, once sufficient for simpler times, often struggle to keep pace with the agility and scalability required today. Distributed systems have become the norm, promising flexibility but introducing their own challenges, such as eventual consistency, fault tolerance, and coordination across services. In such an environment, it is easy to lose sight of the domain—the heart of the problem the software aims to solve.
This is where Domain-Driven Design (DDD) steps in. Since its introduction by Eric Evans in 2003, DDD has served as a transformative approach for designing software systems that reflect the intricacies of real-world domains. The approach offers strategies for modeling complexity, structuring applications, and enabling effective collaboration between technical and business teams. This book is our contribution to the rich ecosystem of DDD knowledge, aiming to guide you through the principles, patterns, and practices that make DDD not just a philosophy but a practical toolset for modern software development.
Who this book is for
Whether you are a software developer, architect, or team lead, this book is crafted to enhance your ability to build systems that are robust, scalable, and aligned with the business they support. Specifically, this book is for the following people:
- Developers who want to move beyond coding and understand how to design systems that solve real-world problems effectively
- Architects tasked with creating modular, maintainable, and scalable solutions in increasingly complex environments
- Technical leaders who seek to foster collaboration between cross-functional teams and ensure that technical decisions support business goals
No matter your role, if you’re passionate about creating software that not only works but thrives under complexity, this book is for you.
What this book covers
, , introduces the origins of DDD, tracing its development from early software engineering practices to its current role in addressing complexity. This chapter explores the fundamental challenges that DDD aims to solve and provides an overview of its key principles, including ubiquitous language and bounded contexts.
, , dives into the nature of complexity in software systems and teaches you how to distinguish between essential and accidental complexity. This chapter introduces tools such as the Cynefin framework and EventStorming, equipping you to navigate problem and solution spaces effectively.
, , covers the strategic aspects of DDD, focusing on dividing domains into bounded contexts and defining clear relationships between them. This chapter teaches you how to apply techniques such as context mapping and how to create a ubiquitous language that fosters collaboration and reduces ambiguity.
, , provides an overview of the tactical building blocks of DDD, such as entities, value objects, aggregates, repositories, and domain services, with practical examples of implementing these patterns in code while maintaining alignment with business rules.
, , teaches you how to identify and address technical debt in legacy systems using DDD principles. This chapter introduces key refactoring strategies, emphasizing the importance of modularity and incremental change to improve the maintainability and scalability supported by various kinds of tests.
, , focuses on transforming monolithic systems into modular architectures. This chapter explores practical steps for decoupling tightly coupled services, identifying bounded contexts, and implementing clear interfaces to simplify interactions.
, , shows you how to implement Command Query Responsibility Segregation with EventSourcing (CQRS+ES). This chapter explains how to use events to decouple systems, ensure scalability, and maintain consistency while managing eventual consistency challenges.
, , provides strategies for aligning database schemas with bounded contexts and refactoring shared tables, as well as introducing patterns such as Expand/Contract. This chapter also covers techniques for handling data consistency in distributed systems.
, , explores how to integrate DDD with continuous integration and delivery practices. This chapter focuses on automation, iterative design, and maintaining alignment between domain models and technical implementation.
, , provides guidance on transitioning from a modular monolith to a microservices architecture. This chapter highlights the trade-offs and complexities of distributed systems and explains how DDD principles can help with this evolution.
, , explains how to manage event versioning in event-sourced systems to ensure compatibility and adaptability over time. This chapter introduces strategies such as upcasting, schema evolution, and content negotiation.
, , explores advanced DDD techniques for managing distributed systems and business processes. Topics covered in this chapter include sagas, choreography versus orchestration, and ensuring system consistency in the face of failures.
To get the most out of this book
This book is designed to be a practical guide for mastering DDD and applying its principles in real-world scenarios. Whether you’re new to DDD or have some prior experience, this book provides a structured approach to help you navigate the complexities of modern software development. At the time of writing this book, all the code was tested with .NET 8 running under Docker Desktop for Windows version 4.36.
| Software/hardware covered in the book | Operating system requirements |
| Docker | Windows, macOS, or Linux |
| C# | Windows, macOS, or Linux |
| RabbitMQ | Windows, macOS, or Linux |
| Kurrent (formerly EventStoreDB) | Windows, macOS, or Linux |
Download the example code files
The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Domain-driven-Refactoring/branches. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781835885949.
Conventions used
There are a number of text conventions used throughout this book.
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: “A possible implementation, again using with the added property, could be as follows.”
A block of code is set as follows:




