Matthew Boyle is an experienced technical leader in the field of distributed systems, specializing in using Go.
Currently an engineering manager at Cloudflare, but with enterprise and startup experience alike, he's the author of Domain-Driven Design with Go (published by Packt and also available from Amazon).
Can you sell Domain-Driven Design to us in a single paragraph?
Domain-Driven Design (DDD) is about ensuring your software matches the real-world problem space you’re designing for. This is powerful as it enables clearer communication with both technical and non-technical colleagues, typically leads to faster software development cycles and makes your software less brittle; meaning you can adapt it to new requirements.
What advice would you give to developers who are new to DDD and want to start incorporating it into their projects?
If there's one thing you take away from my book, it’s that DDD does not need to be "all or nothing" and you can be pragmatic about it. DDD promotes something called “ubiquitous language” which suggests that when specific words are used by your team, there should be no doubt about what they mean. An example of this is the term "user". If I ask marketing what a user is and an engineer what a user is, will they give the same answer?
By creating and publishing a definition for terms such as this that our team agrees on, we can ensure we're aligned. It also will make our code more robust as when we use the term "user", everyone will know exactly what we mean.
Can you share anything about the process of adopting DDD concepts, traditionally associated with OOP, to a more idiomatically Go approach?
I found a lot of the patterns translate fairly easily. For example, adapter patterns and the Open Host Service. Some things like the factory pattern tend to be less widely used in Go. In my book, I did my best to explain each pattern and call out the trade offs that are being made to make it work but I’m certainly open to challenge on it so please get in touch if you think I got it wrong!
In a recent post about writing the book, you expressed apprehension about taking on the responsibility of writing a book. Now it's done, how does it feel?
I had always wanted to write a book and will always be grateful for the opportunity to do so. It has also given me more opportunities since, such as this interview or appearing on the Go Time podcast and enabled me to engage more with folks in the Go community I look up to such as Mat Ryer, Jon Calhoun and Bill Kennedy.
Writing the book is one of the best things I have ever done professionally and I'd encourage others to give it a go!