Slide 1

Slide 1 text

@brunoboucard How a deeper software model enables breakthroughs in product development @kenny_baas @[email protected]

Slide 2

Slide 2 text

@brunoboucard @kenny_baas @[email protected] https://github.com/ddd-​ crew/ddd-​ starter-​ modelling-​ process

Slide 3

Slide 3 text

Allocate places Reservation system places are allocated Movie screening Time-​ out policy (15 min) Cancel allocated places Reservation system Allocated placements are canceled - Reserved places - Free places - Reservation Time-​ out Confirm allocation Website Allocation confirmed Movie visitor No Available places found Change seats policy Change allocation Reservation system Change Allocation App Change of allocation requested Allocation is changed - Reserved places - Free places - Reservation Time-​ out Movie visitor Snapshot of Process modelling This can flood the system, disengaging other people who see it is full Movie visitor Place Allocation 1 Number of tickets Requests App On the Allocated places Requesting Reservations to Creates 2 3 Status of places Tells To placement map Shows To 4 5 payment options App Request tickets Number of tickets requested Movie visitor Allocation policy This can flood the system, disengaging other people who see it is full Confirm allocation Tells to On Payment options Shows To 6 7 Snapshot of Use case: Reserving tickets for a theater The Problem! 80% fill rate @brunoboucard @kenny_baas @[email protected]

Slide 4

Slide 4 text

Seating place Suggestions @brunoboucard Legend Domain Event Information / Read Model Command / Action Policy External System Hotspot Invoked On Issues a Activates a Produces an Results in one or more actor Decides to O bserves Constraint Customer - Suggest 3 availabilities per pricing category Suggestion process - Suggestions is made - Only Suggest available seats - Suggest only adjacent seating - Offer seats that are nearer to the stage Suggestions Accepts suggestion Ask for new suggestion Website Website Suggestion is accepted reserve accepted suggestions Reserve seats Reservation system No Available allocation Found Make a new suggestion provide current reservations Reservation system Current Reservation provided Match Reservations with the layout and make suggestions Provide auditorium layout Auditorium layout Auditorium layout provided Seats Suggestions requested Make Suggestions Seats are allocated Time-​ out policy of 15 min Free up allocation Reservation system allocation is freed up - Reserved seats - Free seats - Reservation Time-​ out Confirm allocation Customer Change seats policy Change allocation Reservation system Change allocation Website allocation is changed allocation is changed - Reserved seats - Free seats - Reservation Time-​ out Customer We start with giving everyone the best suggestion. From there we can optimise and spread out the suggestions process/software Design @kenny_baas @[email protected]

Slide 5

Slide 5 text

Reservations Auditorium Layout App Seating place Suggestions Context Map (design) @brunoboucard @kenny_baas @[email protected]

Slide 6

Slide 6 text

Seating place Suggestions By analysing seat quality, viewer preferences, and theatre layout, it suggests optimal seating choices for theatre visitor. This not only maximizes the viewing experience but also aids in efficient seat management and capacity optimization. @brunoboucard APP make suggestion Suggestions is Made Suggestions are Not Available APP Reservations Reservations Auditorium Layout Auditorium layout Auditorium Seating Pricing Category Row Seating place Only suggest available places Make 3 suggestions per pricing category Offer seats nearer to the stage Offer seats nearer to the middle of the row Only suggest adjacent seating on a row Avoid leaving single seatings between suggestions and reservations People only want to make reservations when sitting together Amount of new suggestions requested make new suggestion How to optimise between suggestions of different people. @kenny_baas @[email protected]

Slide 7

Slide 7 text

Legend Rule Example Only Suggest available seats Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 2 ask to Make Suggestions Then green is suggested Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 2 ask to Make Suggestions Then No suggestions are found Suggest only adjacent seating Offer seats that are nearer to the stage offer seats nearer the middle of a row avoid leaving single seats unbooked on a row, only when there is no other option Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 4 ask to Make Suggestions Then green is suggested Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 4 ask to Make Suggestions Then No suggestions are found Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 4 ask to Make Suggestions Then green is suggested Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 4 ask to Make Suggestions Then green is suggested Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 4 ask to Make Suggestions Then green is suggested Given Red are ReservedSeats 1 2 3 4 5 6 7 8 9 10 When a party of 4 ask to Make Suggestions Then green is suggested Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 4 ask to Make Suggestions Then green is suggested Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 4 ask to Make Suggestions Then green is suggested Example Mapping @brunoboucard A B C Question Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 When a party of 4 ask to Make Suggestions Then green is suggested Given Red are ReservedSeats A B C 1 2 3 4 5 6 7 8 9 10 When a party of 4 ask to Make Suggestions Then green is suggested In the future we might split parties of over 6, preferred on the same row @kenny_baas @[email protected]

Slide 8

Slide 8 text

SeatAllocator Suggests 3 Seat Suggestion per pricing category AuditoriumSeating IAdaptAuditoriumSeating PricingCategory Purpose: Makes sure a suggestion for seats can get allocated to the correct Auditorium Seating AuditoriumSeating Allocate Seats Knows its unique ID Knows if no adjacent seating's are found Suggest seats nearer to the stage Row Purpose: Can suggests Seats per pricing category make Suggestions Suggestions is Made Suggestions are Not Available Suggest 3 availabilities per pricing category Offer seats that are nearer to the stage @brunoboucard In the future we might split parties of over 6, preferred on the same row avoid leaving single seats unbooked on a row, only when there is no other option Suggest only adjacent seating offer seats nearer the middle of a row Only Suggest available seats Reservations Auditorium Layout SeatAllocator Suggest 3 availabilities per pricing category AuditoriumSeating Flipped Purpose: Make sure to suggest 3 availabilities per pricing category What it knows What it does Responsilbities Collaborators Candidate Name CRC cards modelling Seat allocator Purpose? When we shape an object's responsibilities, we are inventing a form that should fit smoothly into its environment. We have the luxury of shaping both form and context when we distribute responsibilities among collaborators. @kenny_baas @[email protected]

Slide 9

Slide 9 text

Purpose: Know if they can be suggested PricingCategory First Second Third SeatAllocator Suggests 3 Seat Suggestion per pricing category AuditoriumSeating IAdaptAuditoriumSeating PricingCategory Purpose: Makes sure a suggestion for seats can get allocated to the correct Auditorium Seating AuditoriumSeating Allocate Seats Knows its unique ID Knows if no adjacent seating's are found Suggest seats nearer to the stage Row Purpose: Can suggests Seats per pricing category Row Allocate seats in row Make sure allocation in adjacent Make sure there are no orphan seats knows the row name knows the amount of free seats Suggest seats towards the middle of the row SeatingPlaceAvailability Purpose: Knows the layout of a row of seats Seating place Knows the row knows the pricing category Knows the seat number Know if it can be suggested or not SeatingPlaceAvailability Pricingcategory make Suggestions Suggestions is Made SeatingPlaceAvailability Reserved available Allocated Suggestions are Not Available Suggest 3 availabilities per pricing category Offer seats that are nearer to the stage In the future we might split parties of over 6, preferred on the same row avoid leaving single seats unbooked on a row, only when there is no other option Suggest only adjacent seating offer seats nearer the middle of a row Only Suggest available seats @brunoboucard Reservations Auditorium Layout @kenny_baas @[email protected]

Slide 10

Slide 10 text

Purpose: Know if they can be suggested PricingCategory First Second Third SeatAllocator Suggests 3 Seat Suggestion per pricing category AuditoriumSeating IAdaptAuditoriumSeating PricingCategory Purpose: Makes sure a suggestion for seats can get allocated to the correct Auditorium Seating AuditoriumSeating Allocate Seats Knows its unique ID Knows if no adjacent seating's are found Suggest seats nearer to the stage Row Purpose: Can suggests Seats per pricing category IAdaptAuditoriumSeating Stores and finds AuditoriumSeating Purpose: Adapts auditorium seating to its last known state. Row Allocate seats in row Make sure allocation in adjacent Make sure there are no orphan seats knows the row name knows the amount of free seats Suggest seats towards the middle of the row SeatingPlaceAvailability Purpose: Knows the layout of a row of seats Seating place Knows the row knows the pricing category Knows the seat number Know if it can be suggested or not SeatingPlaceAvailability Pricingcategory make Suggestions Suggestions is Made SeatingPlaceAvailability Reserved available Allocated Suggestions are Not Available Suggest 3 availabilities per pricing category Offer seats that are nearer to the stage avoid leaving single seats unbooked on a row, only when there is no other option Suggest only adjacent seating offer seats nearer the middle of a row Only Suggest available seats Reservations Auditorium Layout Reservations Auditorium Layout @brunoboucard In the future we might split parties of over 6, preferred on the same row @kenny_baas @[email protected]

Slide 11

Slide 11 text

@brunoboucard We are now here @kenny_baas @[email protected] The DDD Starter Modelling Process - Maxime Sanglan-Cha… YouTube Visual and Collaborative Modelling - Kenny Baas-Schwegle… YouTube More on discovery.....

Slide 12

Slide 12 text

Suggest mixed pricing categories @brunoboucard Challenging the model with a new scenario Cat 1 Cat 2 Cat 3 Suggest next to the 3 pricing categories also 3 times a mixed category. If the seating place were already suggested for the other pricing categories, we can also suggest these in the mixed. Mixed Pricing Category Suggestions Legenda Suggested seating placement in other pricing category suggestion @kenny_baas @[email protected]

Slide 13

Slide 13 text

@brunoboucard Let's go back to the code!! @kenny_baas @[email protected]

Slide 14

Slide 14 text

@brunoboucard Platonic Domain model thinking assumes idealized, abstract representations of reality which may not always capture the intricacies of a domain. This can be misleading in Domain-​ Driven Design (DDD), especially in core or complicated supporting domains where the nuances matter. A naïve model, influenced by this thinking, can confine you to an oversimplified view, potentially leading to incorrect, suboptimal and unadaptable software solutions. Inspired by Barry M O'Reilly - Plato is the devil Platonic Domain Model Thinking Anti-​ Pattern @kenny_baas @[email protected]

Slide 15

Slide 15 text

Introduce a Supple Design in the code to make the domain model be adaptable to domain changes Introduce the concept of a Deep Model in the code to express the concerns of our core domain into our code. What we will do about it? @brunoboucard @kenny_baas @[email protected]

Slide 16

Slide 16 text

@brunoboucard Let's go back to the code!! @kenny_baas @[email protected]

Slide 17

Slide 17 text

@brunoboucard add value objects Use closure of operations Heuristics @kenny_baas @[email protected]

Slide 18

Slide 18 text

@brunoboucard offer seats nearer the middle of a row Introduce the concept of a Deep Model in the code Cat 1 Cat 2 Mixed Pricing Category Suggestions Legenda Suggested seating placement in other pricing category suggestion Cat 1 Cat 2 Auditorium Seating Row SeatingPlace Number 1  ​   ​ 2  ​ 3  ​ 4  ​ 5  ​ 6  ​ 7   ​ 8   ​ 9  ​ 10 Number 1  ​   ​ 2  ​ 3  ​ 4  ​ 5  ​ 6  ​ 7   ​ 8   ​ 9  ​ 10 11 @kenny_baas @[email protected] Number 1  ​   ​ 2  ​ 3  ​ 4  ​ 5  ​ 6  ​ 7   ​ 8   ​ 9  ​ 10 Distance 4  ​   ​ 3  ​ 2  ​ 1  ​ 0  ​ 0  ​ 1   ​ 2   ​ 3  ​ 4

Slide 19

Slide 19 text

@brunoboucard @kenny_baas @[email protected] Row Allocate seats in row Make sure allocation in adjacent Make sure there are no orphan seats knows the row name knows the amount of free seats Suggest seats towards the middle of the row SeatingPlaceAvailability Seating place Knows the row knows the pricing category Knows the seat number Know if it can be suggested or not Distance from the middle of the row SeatingPlaceAvailability Pricingcategory

Slide 20

Slide 20 text

@brunoboucard @kenny_baas @[email protected] Row Allocate seats in row Make sure allocation in adjacent Make sure there are no orphan seats knows the row name knows the amount of free seats Suggest seats towards the middle of the row SeatingPlaceAvailability Seating place with distance Distance from the middle of the row SeatingPlace Seating place Knows the row knows the pricing category Knows the seat number Know if it can be suggested or not SeatingPlaceAvailability Pricingcategory

Slide 21

Slide 21 text

@brunoboucard Start implementation in your unit test Make your domain concepts explicit Heuristics Your code should be explainable on a whiteboard with stakeholders Deep modelling @kenny_baas @[email protected]

Slide 22

Slide 22 text

@brunoboucard “The vital detail about the design is captured in the code. A well-​ written implementation should be transparent, revealing the model underlying it.” - Eric Evans add value objects Use closure of operations Start implementation in your unit test Make your domain concepts explicit Supple design Deep model Your code should be explainable on a whiteboard with stakeholders @kenny_baas @[email protected] Enables

Slide 23

Slide 23 text

Deeper domain concepts, when made explicit in code, enhance developer awareness of core domain concerns. Naïve, platonic models can obscure these concepts, leading to a mismatch between developer understanding and business problems. Misalignment between exploratory models (with domain experts) and domain models in code hinders effective collaboration. Breakthroughs can be restricted if code is anchored to a naïve model due to tight coupling with deeper domain concepts. @brunoboucard @brunoboucard How a deeper software model enables breakthroughs in product development @kenny_baas @[email protected] https://github.com/42skillz/How-​ a-​ deeper-​ software-​ model-​ enables-​ breakthroughs-​ in-​ product-​ development The code:

Slide 24

Slide 24 text

@brunoboucard @brunoboucard @kenny_baas @[email protected] Chapter Thirteen Refactoring toward deeper insights is a multi-​ faceted process. It will be helpful to stop for a moment to pull together the major points. There are thee things you have to focus on. Live in the domain Keep looking at things a different way Maintain an unbroken dialog with domain experts. 1. 2. 3.

Slide 25

Slide 25 text

@brunoboucard Independent software consultant, tech lead, and software architect, I catalyze organizations and teams towards designing and building sustainable and resilient software architectures https://weave-​ it.org https://virtualddd.com @kenny_baas @[email protected] Bruno leads 42 skillz, which aims to help organizations make software work differently. He offers training, coaching, and advice on TDD, BDD, DDD and legacy code refactoring with an extra soul. https://42skillz.com @brunoboucard .linkedin.com/brunoboucard/