This is the code repository for Domain-Driven Design with Golang, published by Packt.
Use Golang to create simple, maintainable systems to solve complex business problems
This book will help Go engineers build high-quality, structured code that fully represents the domain in which they are working. This book also shows you how principles of Domain-driven design can be applied to Go specifically.
This book covers the following exciting features:
- 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
If you feel this book is for you, get your copy today!
All of the code is organized into folders. For example, Chapter02.
The code will look like the following:
=== RUN Test_Point
value_objects_test.go:13: a and b were not equal
--- FAIL: Test_Point (0.00s)
Following is what you need for this book: 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.
With the following software and hardware list you can run all code files present in the book (Chapter 1-8).
Chapter | Software required | OS required |
---|---|---|
1-8 | Go 1.19.3 or above | Windows, macOS, or Linux |
1-8 | VS Code or Goland | Windows, macOS, or Linux |
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.
-
Page 90 (paragraph 2):
To program as defensively as possible, we are going to define a validateAndEnrich function in product.go. This will help us keep our service as thin as possible. Remember, we should always be trying to push down as much logic as possible into our domain objects:
- Let’s add the following code to product.go:
should be
To program as defensively as possible, we are going to define a validateAndEnrich function in purchase.go. This will help us keep our service as thin as possible. Remember, we should always be trying to push down as much logic as possible into our domain objects:
- Let’s add the following code to purchase.go:
Matt Boyle is an experienced technical leader in the field of distributed systems, specializing in using Go. He has worked at huge companies such as Cloudflare & General Electric, as well as exciting high-growth startups such as Curve & Crowdcube. Matt has been writing Go for production since 2018 and often shares blog posts and fun trivia about Go over on Twitter (@MattJamesBoyle).
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.