Chapter 1 · Lesson 1

Welcome to the Masterclass

Domain-Driven Design is how experienced teams keep complex software soft — able to change as fast as the business does. This lesson maps the journey you're about to take, what you'll build, and how to get the most from every section.

In this lesson you'll learn

  • What Domain-Driven Design actually promises — and what it doesn't
  • The full arc of the course, from strategy to tactical code to scaling patterns
  • What "ShopSphere," the single domain you'll build all course, looks like
  • How to use the lessons, labs, projects, and quizzes to actually retain this

Every developer has felt it: a codebase that started clean and, two years later, fights back against every change. A "simple" new rule touches eleven files. Nobody is sure what status = 3 means. The bug you just fixed comes back wearing a different hat.

That pain is rarely about a missing framework or a slow database. It's about a model that drifted away from how the business actually thinks. Domain-Driven Design (DDD) is a set of practices — some about people and conversations, some about code — for keeping that model honest, expressive, and changeable as the business evolves.

The one-sentence definition Domain-Driven Design is the practice of building software whose structure and language deliberately mirror the business domain it serves — so the code stays understandable to developers and faithful to experts at the same time.

What this course covers

DDD has two halves, and most courses teach only one. We teach both, in the order you'd actually use them on a real project.

Strategic design — the big picture

Before any code, you learn to discover the domain and carve it into pieces that make sense: subdomains, the all-important bounded context, the ubiquitous language, and the context maps that describe how the pieces relate. This is the half that decides whether a system stays maintainable for years.

Tactical design — the code

Then you build the model itself: entities, value objects, aggregates that enforce business rules, domain services, repositories, and domain events. Every pattern is shown as real Java 21 / Spring Boot code, not pseudocode.

Architecture & scale — making it last

Finally you wire it all together: hexagonal and clean architecture, CQRS, event sourcing, and the choice between a modular monolith and microservices — with the judgment to know which one a given problem actually needs.

1 · Strategic Subdomains Bounded contexts Context maps 2 · Tactical Entities · Value objects Aggregates · Factories Repositories · Events 3 · Scale Hexagonal · Clean CQRS · Event sourcing Monolith vs services
The course follows the path a real team takes: understand the domain, model it in code, then scale it.

One domain, all the way through: ShopSphere

Switching examples every lesson is exhausting and shallow. Instead, you'll build a single, believable system — ShopSphere, an online retail platform — and return to it from every angle. By the capstone you'll have modeled its whole landscape:

Bounded contextWhat it ownsWhy it's interesting for DDD
CatalogProducts, pricing, descriptionsMostly generic — a good example of where not to over-invest
OrderingCarts, orders, order linesThe core domain — rich invariants live here
InventoryStock levels, reservationsConsistency boundaries and eventual consistency
PaymentCharges, refundsAnti-corruption layers around a third-party provider
ShippingShipments, routes, trackingProcess managers and sagas across contexts

Here's the kind of code you'll be writing by Section 9 — an aggregate that refuses to enter an invalid state:

Order.java — an aggregate root protecting its own invariants

@AggregateRoot
public class Order {

    private final OrderId id;
    private final CustomerId customer;
    private final List<OrderLine> lines = new ArrayList<>();
    private OrderStatus status = OrderStatus.DRAFT;

    // Behavior, not setters: the rule lives with the data it protects.
    public void addLine(Sku sku, Quantity qty, Money unitPrice) {
        if (status != OrderStatus.DRAFT) {
            throw new OrderAlreadyPlacedException(id);
        }
        lines.add(new OrderLine(sku, qty, unitPrice));
    }

    public Money total() {
        return lines.stream()
                    .map(OrderLine::subtotal)
                    .reduce(Money.zero("USD"), Money::add);
    }
}
You don't need to understand this yet If @AggregateRoot, Sku, or "invariant" mean nothing to you right now, that's exactly the point — by the time you reach Section 9 you'll write this fluently and know why every line is shaped the way it is.

How to get the most from this course

  1. Read in order, at least the first time The course is deliberately sequenced: strategy before tactics, simple before scaled. Later sections assume the earlier ones. Resist the urge to jump straight to "Microservices."
  2. Do the labs and projects — don't just read them Each section ends with a hands-on exercise on ShopSphere. DDD is a modeling skill, and modeling is learned by doing, getting it slightly wrong, and refining.
  3. Take the section quizzes A short quiz closes every core section. Score 80% to mark it complete. They're designed to catch the subtle misunderstandings that derail real DDD projects.
  4. Track your progress Your completed lessons are saved in this browser (look at the progress bar up top). Use "Mark as complete" at the bottom of each page.
Prerequisites, honestly You need comfort with object-oriented programming and the ability to read Java. You do not need prior DDD experience, nor deep Spring or Axon knowledge — we introduce each tool the first time it's used.

Key takeaways

  • DDD keeps software changeable by making the code mirror the business domain and its language.
  • The course covers both halves of DDD — strategic design (discovery, boundaries) and tactical design (the model in code) — plus the architecture to scale it.
  • You'll build one coherent domain, ShopSphere, from discovery through a full capstone.
  • Learn by doing: every section has a lab or project and a quiz; progress is saved as you go.