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

Deep Dive into Model-Driven Design: Refining D...

Deep Dive into Model-Driven Design: Refining Domain Models in Code @ TeqNation

Most software products begin with an initial software model, one that is typically naive and superficial, grounded in basic understanding. This initial phase is natural, as it aligns with the early stages of discovering and exploring a new product with stakeholders. Initially, the process involves identifying nouns and verbs to create the first objects and methods in our code. While this early model enables quick feedback for the product, it often becomes less effective over time. As more feedback is gathered, the model usually fails to accurately reflect the main concerns of domain experts, becoming less relevant for the product's development. The absence of a model that mirrors the domain's core aspects can prevent adjustments to the code based on changing stakeholder needs, potentially blocking product innovations. Additionally, the gap between the code and the domain model leads to missed opportunities for insights, as the code no longer represents our domain knowledge accurately.

Join us in this live coding talk session focused on the significance of continuously refining your core domain models in code. We will introduce you to the context by guiding you through several collaborative modelling techniques such as Eventstorming, Domain Storytelling, Context Mapping, CRC-cards and more. We then dive into coding challenges using C# where you'll witness firsthand the transformative power of supple design and a deeper model. By the end, you'll understand how continuously refactoring the model can be pivotal in driving product development breakthroughs. You'll depart with enriched practical insights and a Deep Dive of Part III of Evans’s groundbreaking work on Domain-Driven Design (DDD) that goes beyond basic concepts like aggregates, entities, and value objects.

Kenny Baas-Schwegler

May 22, 2024
Tweet

More Decks by Kenny Baas-Schwegler

Other Decks in Programming

Transcript

  1. @brunoboucard @kenny_baas @[email protected] Domain-​ Driven Design is a discipline rooted

    in the belief that creating good software systems for problems in the complex domain cannot be done without a deep understanding of the business problems you are trying to solve in the domain.
  2. @brunoboucard @kenny_baas @[email protected] Users and stakeholders Code Stream-​Aligned Team Tests

    Domain Model Other people possibly involved in designing and building software Managers Architects User researcher .....
  3. @brunoboucard @kenny_baas @[email protected] 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. 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.
  4. @brunoboucard @kenny_baas @[email protected] Purpose: Know if they can be suggested

    Seating Place Suggesting maker Make 3 different suggestion per pricing Category Auditorium Seating AuditoriumSeatings Purpose: Makes sure a suggestion for seats can get allocated to the correct Auditorium Seating Auditorium Seating Allocate Places Knows its unique ID Suggest places options closer to the stage Row Purpose: Has the overview of all the rows. Auditorium Seatings Finds Auditorium Seating Purpose: Adapts auditorium seating to its last known state. Row - Suggests places in row - Make sure suggestions are adjoining - Make sure there individual places vacant in a row - knows the row name - knows the amount of free seats - Suggest places options closer to the center of a row Seating Place Purpose: Knows the layout of a row of places Seating place Knows the row knows the pricing category Knows the seat number Know if it can be suggested or not Seating Place Availability Seating Place Availability Reserved available Allocated Auditorium Seating Pricing Category First Second Third 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.
  5. @brunoboucard @kenny_baas @[email protected] Purpose: Know if they can be suggested

    Seating Place Suggesting maker Make 3 different suggestion per pricing Category Auditorium Seating AuditoriumSeatings Purpose: Makes sure a suggestion for seats can get allocated to the correct Auditorium Seating Auditorium Seating Allocate Places Knows its unique ID Suggest places options closer to the stage Row Purpose: Has the overview of all the rows. Auditorium Seatings Finds Auditorium Seating Purpose: Adapts auditorium seating to its last known state. Row - Suggests places in row - Make sure suggestions are adjoining - Make sure there individual places vacant in a row - knows the row name - knows the amount of free seats - Suggest places options closer to the center of a row Seating Place Purpose: Knows the layout of a row of places Seating place Knows the row knows the pricing category Knows the seat number Know if it can be suggested or not Seating Place Availability Seating Place Availability Reserved available Allocated Auditorium Seating Pricing Category First Second Third This an initial software model, one that is grounded in basic understanding. Does that model over time fail to accurately reflect the main concerns of domain experts?
  6. Suggest mixed pricing categories 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 @brunoboucard @kenny_baas @[email protected]
  7. Cat 1 Cat 2 Suggest places options closer to the

    center of a row Cat 1 Cat 2 Number 1  ​   ​ 2  ​ 3  ​ 4  ​ 5  ​ 6  ​ 7   ​ 8   ​ 9  ​ 10 Number 1  ​   ​ 2  ​ 3  ​ 4  ​ 5  ​ 6  ​ 7   ​ 8   ​ 9  ​ 10 11 @brunoboucard @kenny_baas @[email protected] Party of 2 Purpose: Know if they can be suggested Auditorium Seating Allocate Places Knows its unique ID Suggest places options closer to the stage Row Purpose: Has the overview of all the rows. Row - Suggests places in row - Make sure suggestions are adjoining - Make sure there individual places vacant in a row - knows the row name - knows the amount of free seats - Suggest places options closer to the center of a row Seating Place Purpose: Knows the layout of a row of places Seating place Knows the row knows the pricing category Knows the seat number Know if it can be suggested or not Seating Place Availability
  8. 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 @brunoboucard @kenny_baas @[email protected]
  9. 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 @brunoboucard @kenny_baas @[email protected]
  10. Start implementation in your unit test Make your domain concepts

    explicit Heuristics Your code should be explainable on a whiteboard with stakeholders Deep modelling @brunoboucard @kenny_baas @[email protected]
  11. “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 Enables @brunoboucard @kenny_baas @[email protected]
  12. 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. How a deeper software model enables breakthroughs in product development https://github.com/42skillz/How-​ a-​ deeper-​ software-​ model-​ enables-​ breakthroughs-​ in-​ product-​ development The code: @brunoboucard @kenny_baas @[email protected]
  13. 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. @brunoboucard @kenny_baas @[email protected]
  14. @brunoboucard @kenny_baas @[email protected] Want to know more? www.avanscoperta.it Deep Dive

    into Model- Driven Design Workshop | Avanscoperta Online | Get to experience the true power of Domain-Driven Design and go beyond using the basic tactical patterns. https://www.avanscoperta.it/en/training/deep-​ dive-​ into-​ model-​ driven-​ design-​ workshop/
  15. @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://octo.com @brunoboucard .linkedin.com/brunoboucard/