Skip to content

Instantly share code, notes, and snippets.

@nickcharlton
Last active October 6, 2021 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickcharlton/e1489ba9cb3e061e91211936a520277d to your computer and use it in GitHub Desktop.
Save nickcharlton/e1489ba9cb3e061e91211936a520277d to your computer and use it in GitHub Desktop.
Domain Driven Design & Event Storming

Domain Driven Design

  • Ubiquitous Language: the language used by everyone to describe the concepts spoken about (so that they are all on the same page)
  • Bounded Context: "a semantic contextual boundary"; within the boundary, each component has a specific meaning and does specific things
  • Domain:
    • Core Domain: the strategic scope which is core to the business/software product
    • Sub-domain: a sub-part of the overall business domain (supporting is ancillary to the core, but worth implementing in-house, whilst generic isn't, e.g.: user invoicing)
  • Domain Event: a record of some significant event occurring in a bounded context, which can be consumed inside the originating bounded context or by other bounded contexts
  • Aggregate/Entity/Data: a high-level type or model (it may be composed of entities and value objects)
  • Command: an operation which causes a domain event

Event Storming

A collaborative process to define the domain events within a bounded context.

  1. Begin by storming (collaboratively, simultaneously, putting together) domain events by going through the business processes needed to complete a task. Each should be a verb in the past tense (e.g.: ProductCreated). Use orange post-its.
    • place events in time order,
    • simultaneous events can be stacked below another
  2. Create the commands which cause the domain event. On a light-blue post-it, name the action which causes the domain event to occur (in the imperative, e.g.: CreateProduct), place it to the left of the domain event which it causes. Sometimes, one command creates multiple events: place the command to the left of the stacked events.
  3. Associate the aggregate which the command operates on and the domain event; the data holder where Commands are executed and Events are emitted. Using a yellow post-it, place behind and slightly above the Command and Event pair.
    • repeat the aggregate post-it for each occurrence,
  4. Separate bounded contexts by how these all align (they may be via departmental boundaries, or where people disagree on responsibilities). Use arrows to join the data flows between the different bounded contexts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment