Course / M4
Module 4 of 12

The core components: a selected toolkit

Choose the words, then refuse the rest

Build the small shared vocabulary humans and agents need for delegation: commands, events, queries, handlers, aggregates, entities, value objects, domain services, ports, and read models.

10 sections

Start this module →

  1. 01

    Choose the words, then refuse the rest

    ✎ Text

    Build a small shared vocabulary that a human and an agent can both hold.

  2. 02

    Three kinds of message: command, event, query

    ✎ Text

    Keep commands, events, and queries separate to buy cheap clarity throughout the system.

  3. 03

    The command handler, formalised

    ✎ Text

    A handler coordinates one behavior through ports; it does not make the domain decision.

  4. 04

    The aggregate: where “must never happen” is guaranteed

    ✎ Text

    Use an aggregate as the transactional boundary that makes invariants structurally impossible to break.

  5. 05

    Entities and value objects

    ✎ Text

    Separate objects with durable identity from immutable values defined by their attributes.

  6. 06

    Domain services: logic that belongs to no single thing

    ✎ Text

    Put genuine cross-aggregate domain decisions in a domain service.

  7. 07

    Ports

    ✎ Text

    Ports are interfaces the core owns; adapters are implementation details outside the core vocabulary.

  8. 08

    The read model

    ✎ Text

    Keep a read shape for answering questions separate from the write shape that guards rules.

  9. 09

    The pieces, assembled

    ✎ Text

    Put the vocabulary together on one feature and the flow becomes precise.

  10. 10

    Standard component for optimal delegation

    ✎ Text

    Translate features into precise component words so the agent has fewer gaps to guess into.