Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DDD Vienna 2018: Event storming! Putting it all...

DDD Vienna 2018: Event storming! Putting it all together.

Event Storming Workshop, DDD Vienna Meetup, March 23rd 2018

Martin Schimak

March 23, 2018
Tweet

More Decks by Martin Schimak

Other Decks in Programming

Transcript

  1. Event storming starts with brainstorming events. Goods shipped Order placed

    Goods fetched Payment received „We need to create a set of facts to create value for customers!“
  2. Events are just that: facts Something happened! Now it‘s in

    the past. And therefore in the past tense! Payment received
  3. Somebody needs to create the facts Nothing „really“ happened so

    far! Apart from that we intend to create new facts! :-) Request payment
  4. First, start with some of the facts… Goods shipped Order

    placed Goods fetched Payment received Order fulfilled
  5. … then add some commands as appropriate Goods shipped Order

    placed Goods fetched Payment received Place order Request payment Fetch goods Ship goods Order fulfilled
  6. Some commands might be triggered by users… Goods shipped Order

    placed Goods fetched Payment received Place order Request payment Fetch goods Ship goods Order fulfilled
  7. …whereas others happen because of internal policies Goods shipped Order

    placed Goods fetched Payment received Place order Request payment Fetch goods Ship goods Order fulfilled Policy
  8. Policies sit in between events and commands If this then

    that! Order placed Request payment The simplest possible policy is that whenever an event happens, we always follow up with a command
  9. Use policies to indicate the more interesting stuff! Order placed

    Place order Order fulfilled Goods fetched Fetch goods Payment received Request payment Optionally wait for payment Ship goods Goods shipped When shipped and paid Mark order fulfilled
  10. You might want to indicate external systems Order placed Place

    order Order fulfilled Goods fetched Fetch goods Payment received Request payment Optionally wait for payment Ship goods Goods shipped When shipped and paid Mark order fulfilled Inventory system
  11. When you don‘t like some stuff schedule it for removal

    Order placed Place order Order fulfilled Goods fetched Fetch goods Payment received Request payment Optionally wait for payment Ship goods Goods shipped When shipped and paid Mark order fulfilled Coffee brewed
  12. Domain Event Optionally we show a specific policy triggering a

    command Command Command (Optional) Policy
  13. Domain Event (Optional) Policy Command Command Optionally we show a

    command is invoked on external systems (Optional via) External System
  14. Domain Event (Optional) Policy Command Command Our legend for today.

    We never (ever) use arrows! :-) (Optional via) External System
  15. Read Model Domain Event Aggregate Policy Command External System UI

    Command Invoked on raises raises Invoked on projected onto listened to by triggers triggers Inspired by the picture that explains (almost) everything :-) * *) Idea: the ingenious Alberto Brandolini
  16. Brussels APRIL 11-13, 2018 Advanced Domain–Driven Design MATHIAS VERRAES APRIL

    12-13, 2018 EventStorming Master Class ALBERTO BRANDOLINI Paris MAY 24-25, 2018 Essential Domain–Driven Design PAUL RAYNER JUNE 26-29, 2018 DDD Immersion ERIC EVANS