$30 off During Our Annual Pro Sale. View Details »

EventStorming, BDD and sick teachers!

EventStorming, BDD and sick teachers!

A little workshop about "Exploring behaviour before structure".
@martinschimak and @paulroho -> June 22nd, 2018 -> DDDesign Vienna

Martin Schimak

June 22, 2018
Tweet

More Decks by Martin Schimak

Other Decks in Programming

Transcript

  1. Exploring behaviour before structure.
    @martinschimak and @paulroho -> June 22nd, 2018 -> Domain-Driven Design Vienna
    EventStorming, BDD and sick teachers!

    View Slide

  2. Do you still remember school? And escaping its „structural model“! :-)

    View Slide

  3. Mon Tue Wed Thu Fri
    8:00 – 8:50 Mathematics
    Christiane Lorch
    Sports
    Mathias Wils
    English
    Stefanie Keller
    Vocals
    Reinhold Kneer
    History
    Tobias Puth
    8:55 – 9:45 Ethics
    Arnold Unger
    Sports
    Mathias Wils
    History
    Tobias Puth
    Vocals
    Reinhold Kneer
    French
    Monique Perron
    9:55 – 10:45 French
    Monique Perron
    English
    Stefanie Keller
    Music
    Heidi Sokolowski
    Biology
    Tatjana Nelles
    Geography
    Fabio Baie
    10:50 – 11:40 German
    Julian Wellner
    French
    Monique Perron
    Mathematics
    Christiane Lorch
    Music
    Heidi Sokolowski
    German
    Julian Wellner
    11:55 – 12:45 Music
    Heidi Sokolowski
    German
    Julian Wellner
    French
    Monique Perron
    English
    Stefanie Keller
    German
    Julian Wellner
    12:50 – 13:40 Music
    Heidi Sokolowski
    - Ethics
    Arnold Unger
    Mathematics
    Christiane Lorch
    Mathematics
    Christiane Lorch
    5c - 2017/18 International Music Highschool 1090 Vienna

    View Slide

  4. Group brainstorming: How do we call the
    structural elements we find in a school‘s timetable?

    View Slide

  5. Structural models don‘t convey what HAPPENS going through time.

    View Slide

  6. Events? Something happened!
    Teacher
    absence
    reported

    View Slide

  7. Quick group brainstorming: who
    is affected by such an event?
    Teacher
    absence
    reported

    View Slide

  8. More brainstorming leads to more events!
    Teacher
    absence
    reported
    Substitute
    informed
    Lesson
    canceled
    Parents
    informed

    View Slide

  9. Policies… when decisions need to be made!
    Teacher
    absence
    reported
    Substitute
    informed
    Lesson
    canceled
    Parents
    informed
    Substitutes
    decision

    View Slide

  10. Substitute
    informed
    Lesson
    canceled
    Parents
    informed
    Substitutes
    decision
    Commands... when decisions need to be executed!
    Cancel
    lesson
    Inform
    substitute
    Teacher
    absence
    reported

    View Slide

  11. Group EventStorming: What would need to happen when it happens?
    Teacher
    absence
    reported

    View Slide

  12. Quick question: what triggers you to add a new sticky or remove one?

    View Slide

  13. Describing software behaviour with Gherkin
    GIVEN a state to be assumed
    WHEN we trigger a change
    THEN we will observe an expected result Verify
    Setup
    Execute

    View Slide

  14. A policy. And a possible rule detailing it.
    - Preferredly, teachers that teach a class in another
    subject are chosen to substitute absent teachers.
    - …
    Substitutes
    decision

    View Slide

  15. Gherkins to describe rules detailing a policy
    GIVEN a set of events happened
    WHEN another event happens
    THEN a command will follow – or not Command
    Decision
    rules
    Domain
    event
    Domain
    event
    Domain
    event

    View Slide

  16. Group work: When looking at your policies,
    what would be specific scenarios (expressed as
    examples) illustrating one of the decision rules?

    View Slide

  17. FEATURE: Substitutes Decision. Policy to decide who shall substitute an absent teacher.
    SCENARIO: Preferredly, teachers that teach a class in another subject are chosen to substitute absent teachers.
    GIVEN the following teachers are assigned to teach 5c:
    | Teacher | Subject |
    | Christiane Lorch | Mathematics |
    | Julian Wellner | German |
    AND 5c has a mathematics lesson scheduled
    on Wednesday 10:50 to 11:40
    AND Julian Wellner is reserved as substitute
    on Wednesday 10:50 to 11:40
    WHEN Christiane Lorch reports her absence
    THEN Julian Wellner shall substitute
    Christiane Lorch on Wednesday 10:50 to 11:40 Substitute
    lesson
    Substitutes
    decision
    Teacher
    absence
    reported
    Teacher
    assigned
    to class
    Lesson
    scheduled
    for class
    Teacher
    assigned to
    teach class
    Teacher
    reserved as
    substitute

    View Slide

  18. Gherkins to describe rules when executing a command
    GIVEN a set of events happened
    WHEN a command executes
    THEN another event will happen – or not
    Command
    Consistency
    rules
    Domain
    event
    Domain
    event
    Domain
    event

    View Slide

  19. FEATURE: Substitute lesson. A teacher shall be assigned to substitute for a specific lesson.
    SCENARIO: A substitute teacher must not be assigned to conflicting duties.
    GIVEN Julian Wellner is assigned to substitute
    Arnold Unger on Monday 08:00 to 08:50
    WHEN Julian Wellner shall substitute
    Christiane Lorch on Monday 08:00 to 08:50
    THEN Julian Wellner will not be assigned to substitute
    Christiane Lorch on Monday 08:00 to 08:50
    Substitute
    lesson
    Teacher
    assigned to
    substitute
    Teacher
    assigned to
    substitute

    View Slide

  20. Gherkins to describe rules for creating a report
    GIVEN a set of events happened
    WHEN another event happens
    THEN a report will reflect the expected state
    Projection
    rules
    Domain
    event
    Domain
    event
    Report

    View Slide

  21. FEATURE: Time table. Report reflecting the actual lessons scheduled for a specific class.
    SCENARIO: A substitution is reflected in the time table for the affected class.
    GIVEN Christiane Lorch is assigned to teach
    mathematics in 5c
    AND 5c has a mathematics lesson scheduled
    on Wednesday 10:50 to 11:40
    WHEN Julian Wellner substitutes
    Christiane Lorch on Wednesday 10:50 to 11:40
    THEN 5c time table will reflect Julian Wellner as
    substitute on Wednesday 10:50 to 11:40
    AND 5c time table will reflect a german lesson scheduled
    on Wednesday 10:50 to 11:40
    Teacher
    assigned to
    substitute
    Time
    table
    Lesson
    scheduled
    for class
    Teacher
    assigned to
    teach class

    View Slide

  22. Mon Tue Wed Thu Fri
    8:00 – 8:50 Mathematics
    Christiane Lorch
    Sports
    Mathias Wils
    English
    Stefanie Keller
    Vocals
    Reinhold Kneer
    History
    Tobias Puth
    8:55 – 9:45 Ethics
    Arnold Unger
    Sports
    Mathias Wils
    History
    Tobias Puth
    Vocals
    Reinhold Kneer
    French
    Monique Perron
    9:55 – 10:45 French
    Monique Perron
    English
    Stefanie Keller
    Music
    Heidi Sokolowski
    Biology
    Tatjana Nelles
    Geography
    Fabio Baie
    10:50 – 11:40 German
    Julian Wellner
    French
    Monique Perron
    German
    Julian Wellner
    Music
    Heidi Sokolowski
    German
    Julian Wellner
    11:55 – 12:45 Music
    Heidi Sokolowski
    German
    Julian Wellner
    French
    Monique Perron
    English
    Stefanie Keller
    German
    Julian Wellner
    12:50 – 13:40 Music
    Heidi Sokolowski
    - Ethics
    Arnold Unger
    Mathematics
    Christiane Lorch
    Mathematics
    Christiane Lorch
    5c - 2017/18 International Music Highschool 1090 Vienna

    View Slide

  23. Group discussion: What do you think about relating
    EventStorming results to Gherkin example scenarios?

    View Slide

  24. View Slide

  25. View Slide

  26. View Slide