Three Years of DDD in Practice: Insights from the Opening Chapter

The author recounts three years of applying Domain‑Driven Design to a microservice ecosystem, sharing concrete pitfalls, code‑first modeling from database tables, and a structured 24‑article series that guides developers to refactor existing Spring Boot + MyBatis Plus projects without rewriting the framework.

samdeepthink
samdeepthink
samdeepthink
Three Years of DDD in Practice: Insights from the Opening Chapter

Three years ago the CTO mandated that every microservice adopt Domain‑Driven Design (DDD). With only a superficial understanding from a few articles, the author bought Eric Evans' and Vaughn Vernon's books, studied numerous blogs, and began experimenting in the codebase.

During this period the team hit many pitfalls: mis‑defining aggregate boundaries, blurring responsibilities between domain services and application services, and struggling with how MyBatis Plus maps value objects. Each issue was identified and resolved through hands‑on trial and error.

Now all microservices run on a unified DDD structure, allowing any team member to follow the same conventions. This column series documents those three years of experience, focusing on production‑ready code structures and design decisions rather than abstract theory.

The series takes a "code first" approach, starting from real database tables (order, allocation, receipt, statistics). From table fields and relationships it demonstrates how to identify aggregate roots, split sub‑entities, extract value objects, locate business rules, and organize cross‑module collaboration.

DDD workflow diagram
DDD workflow diagram

The column consists of 24 articles divided into seven modules:

Module 1 – Introduction (2 articles)

Module 2 – From Table to Aggregate (6 articles)

Module 3 – Layering and CQRS (4 articles)

Module 4 – Services and Orchestration (3 articles)

Module 5 – Bounded Contexts and Events (4 articles)

Module 6 – Practical Guidelines (3 articles)

Module 7 – Architectural Thinking (2 articles)

Each article walks through concrete code examples, such as designing an AggregateRoot base class, handling sub‑entities, extracting value objects, applying CQRS, defining domain services, and using hexagonal and clean architecture principles.

DDD has no single correct answer; the presented approach blends book‑based concepts with project‑specific trade‑offs discovered over three years. Readers can apply the same step‑by‑step method to refactor any module in their own Spring Boot + MyBatis Plus projects without rewriting code or changing frameworks.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Domain-Driven DesignSpring BootMyBatis PlusCQRShexagonal-architectureBounded ContextAggregates
samdeepthink
Written by

samdeepthink

Knowledge Planet: Old Dock's Tech Chronicles Zhihu: SamDeepThinking A technical manager who still codes heavily on the front line. From junior developer to tech lead, then tech manager, now leading the whole front‑ and back‑end development team—leveling up along the way. I have some insights on programming, career development, and tech management.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.