
Domain-Driven Design with Golang: Use Golang to create simple, maintainable systems to solve complex business problems
- Length: 204 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2022-12-16
- ISBN-10: 1804613452
- ISBN-13: 9781804613450
- Sales Rank: #695863 (See Top 100 Books)
Understand the concept of Domain-driven design and build two DDD systems from scratch that can be showcased as part of your portfolio
Key Features
- Explore Domain-driven design as a timeless concept and learn how to apply it with Go
- Build a domain-driven monolithic application and a microservice from scratch
- Leverage patterns to make systems scalable, resilient, and maintainable
Book Description
Domain-driven design (DDD) is one of the most sought-after skills in the industry. This book provides you with step-by-step explanations of essential concepts and practical examples that will see you introducing DDD in your Go projects in no time. Domain-Driven Design with Golang starts by helping you gain a basic understanding of DDD, and then covers all the important patterns, such as bounded context, ubiquitous language, and aggregates. The latter half of the book deals with the real-world implementation of DDD patterns and teaches you how to build two systems while applying DDD principles, which will be a valuable addition to your portfolio. Finally, you’ll find out how to build a microservice, along with learning how DDD-based microservices can be part of a greater distributed system. Although the focus of this book is Golang, by the end of this book you’ll be able to confidently use DDD patterns outside of Go and apply them to other languages and even distributed systems.
What you will learn
- Get to grips with domains and the evolution of Domain-driven design
- Work with stakeholders to manage complex business needs
- Gain a clear understanding of bounded context, services, and value objects
- Get up and running with aggregates, factories, repositories, and services
- Find out how to apply DDD to monolithic applications and microservices
- Discover how to implement DDD patterns on distributed systems
- Understand how Test-driven development and Behavior-driven development can work with DDD
Who this book is for
This book is for intermediate-level Go developers who are looking to ensure that they not only write maintainable code, but also deliver great business value. If you have a basic understanding of Go and are interested in learning about Domain-driven design, or you’ve explored Domain-driven design before but never in the context of Go, then this book will be helpful.
Cover Title Page Copyright and credits Contributors About the reviewers Table of Contents Preface Part 1: Introduction to Domain-Driven Design Chapter 1: A Brief History of Domain-Driven Design The world before DDD So, what are OOD patterns? Eric Evans and DDD Three pillars of DDD Adoption of DDD When should you use DDD? Summary Further reading Chapter 2: Understanding Domains, Ubiquitous Language, and Bounded Contexts Technical requirements Setting the scene Domains and sub-domains Ubiquitous language Benefits of ubiquitous language Bounded contexts Open Host Service Published language Anti-corruption layer Summary Further reading Chapter 3: Entities, Value Objects, and Aggregates Technical requirements Working with entities Generating good identifiers A warning when defining entities A note on object-relational mapping Working with value objects How should I decide whether to use an entity or value object? The aggregate pattern Discovering aggregates Designing aggregates Aggregates beyond a single bounded context Summary Further reading Chapter 4: Exploring Factories, Repositories, and Services Technical requirements Introducing the factory pattern Entity factories Implementing the repository pattern in Golang Understanding services Domain services Application services Summary Part 2: Real -World Domain-Driven Design with Golang Chapter 5: Applying Domain-Driven Design to a Monolithic Application Technical requirements What do we mean when we say monolithic application? Setting the scene Getting started with our CoffeeCo system Implementing our product repository Adding an infrastructure service for payment handling Paying with CoffeeBux Adding store-specific discounts Extending our service Summary Further reading Chapter 6: Building a Microservice Using DDD Technical requirements A friendly warning (again) What do we mean by microservices? What are the benefits of microservices? What are the downsides of microservices? Should my company adopt microservices? Setting the scene (again) Building a recommendation system Revisiting the anti-corruption layer Exposing our service via an open host service Summary Chapter 7: DDD for Distributed Systems Technical requirements What is a distributed system? CAP theorem and databases Distributed system patterns CQRS EDA Dealing with failure Two-phase commit (2PC) The saga pattern What is a message bus? Kafka RabbitMQ NATS Summary Further reading Chapter 8: TDD, BDD, and DDD Technical requirements TDD Adding a test Run the test we just wrote – it should fail (and we should expect it to) Write as little code as possible to pass the test Refactoring BDD Summary Index Other Books You May Enjoy
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Domain-Driven Design with Golang: Use Golang to create simple, maintainable systems to solve complex business problems
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.