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

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!
  2. 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
  3. Policies… when decisions need to be made! Teacher absence reported

    Substitute informed Lesson canceled Parents informed Substitutes decision
  4. Substitute informed Lesson canceled Parents informed Substitutes decision Commands... when

    decisions need to be executed! Cancel lesson Inform substitute Teacher absence reported
  5. 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
  6. 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
  7. 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
  8. Group work: When looking at your policies, what would be

    specific scenarios (expressed as examples) illustrating one of the decision rules?
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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