Practical Domain-Driven Design in Go
$12.00
Minimum price
$15.00
Suggested price

Practical Domain-Driven Design in Go

About the Book

Learn how to build Go applications that honor your core logic and stay easy to understand and maintain. Practical Domain-Driven Design in Go uses a online store as an example to on how to structure your code around clear domain models and rules.

This book explains how to:

  • Create a isolated domain layer that captures your core business logic
  • Build an infrastructure layer that supports domain with HTTP, async messaging and databases
  • Use practical testing strategies to keep you productive
  • Handle everyday challenges like transactions, filters, and validations in a simple way

Because the book is a work in progress, your feedback will help shape its final form. Chapters and paragraphs are constantly rewritten. Table of content changes. There still might be TODO lines inside pages of the book. Send feedback to book at benetis.me

About the Author

Table of Contents

  • 1 Before you begin
    • 1.1 Source code
    • 1.2 Domain-Driven design by Eric Evans
    • 1.3 Differences from usual DDD
    • 1.4 Legend
  • 2 About this book
    • 2.1 Intended Audience
    • 2.2 Prerequisites
    • 2.3 What You Will Learn
    • 2.4 Purpose and Approach
  • 3 Introduction to Domain-Driven Design
    • 3.1 What is Domain-Driven Design?
    • 3.2 Key Aspects
    • 3.3 When to DDD?
      • 3.3.1 Benefits
      • 3.3.2 Challenges in securing organizational buy-in
  • 4 Introduction to case study
    • 4.1 Business requirements
      • 4.1.1 Na\"ive approach
      • 4.1.2 First iteration
  • 5 Layers: Business Domain Layer
    • 5.1 Domain models
      • 5.1.1 Product examples
      • 5.1.2 Clarify meaning of ''model'' in codebase
      • 5.1.3 Models in Online Store 1.0
    • 5.2 Domain services
      • 5.2.1 Implementation example
  • 6 (empty) Aggregates, Entities, Value Objects
  • 7 Invariants
    • 7.1 Introduction
    • 7.3 Add products to cart example
    • 7.4 Type System
  • 8 Entity IDs
    • 8.1 Human-Readable UUIDs
    • 8.2 TypeID
    • 8.3 Performance considerations
  • 9 Layers: Infrastructure layer
    • 9.1 Communications: HTTP
      • 9.1.1 Code generation
      • 9.1.2 Handler implementation
      • 9.1.3 Transforming domain layer structures to infrastructure layer
    • 9.2 Repositories
      • 9.2.1 Inferfaces
      • 9.2.2 Mapping aggregates to tables
      • 9.2.3 Transactions
    • 9.3 External and internal clients
  • 10 Layers: Application and Shared layers
    • 10.1 Application layer
    • 10.2 Shared layer
    • 10.3 Summary
  • 11 (work-in-progress) Testing: Overview and Examples
    • 11.1 Testing with actual implementations
    • 11.2 Testing library: goconvey
    • 11.3 Domain tests: testing inventory service
    • 11.5 Tooling: Taming complexity due bi-directional layer dependencies in tests
  • 12 (work-in-progress) Between layers: Errors, Filters, Validations
    • 12.1 Error handling
    • 12.2 Filtering
    • 12.3 Ordering
    • 12.4 Validations
      • 12.4.1 Input validation
      • 12.4.2 Model validation
  • 13 (empty) Bounded Contexts and Context Mapping
  • 14 (empty) Domain Events and Services
  • 15 Durable execution
    • 15.1 Motivation and overview
    • 15.2 Temporal in Go
    • 15.3 Payments integration workflow
    • 15.4 (work-in-progress) Integrating into DDD codebase
  • 16 (empty) Bonus chapters
    • 16.1 Interactors
    • 16.2 In-Memory repositories for testing

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub