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

Domain Storytelling

Domain Storytelling

Talk on Domain Storytelling

Henning Schwentner

June 29, 2023
Tweet

More Decks by Henning Schwentner

Other Decks in Programming

Transcript

  1. Starring With
    Directed by
    as
    Written by

    View Slide

  2. View Slide

  3. !

    View Slide

  4. @hschwentner

    View Slide

  5. Foto: Rameessos/Wikipedia

    View Slide

  6. @hschwentner
    Spark a fire !
    Tell a story "
    Paint a picture #

    View Slide

  7. View Slide

  8. !

    View Slide

  9. !

    View Slide

  10. Painting a picture
    "

    View Slide

  11. View Slide

  12. View Slide

  13. View Slide

  14. !"#
    Kolleg:in gesucht
    (Deutschlandweit)

    View Slide

  15. View Slide

  16. Story Time

    View Slide

  17. View Slide

  18. View Slide

  19. @hschwentner
    Do I get a car for this?

    View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. Monolease

    View Slide

  25. @hschwentner
    To split the Monolith we first
    have to put it aside

    View Slide

  26. thinking
    about
    business
    =>
    thinking
    about
    technology
    to

    View Slide

  27. customer
    tells wish for
    1
    salesperson
    signs
    to
    gives
    for
    contract
    3
    risk manager
    contract
    passes on
    to
    4
    contract
    votes
    checks
    calculates
    5
    6
    7
    calculates
    to
    8
    2
    car
    credit
    rating
    installment
    car
    resale
    value
    contract

    View Slide

  28. @hschwentner
    Explained

    View Slide

  29. Collaborative Modeling

    View Slide

  30. Domain
    Expert
    Developer

    View Slide

  31. Knowledge crunching

    View Slide

  32. View Slide

  33. Collaborative Modeling
    User Story
    Mapping

    View Slide

  34. @hschwentner
    Domain Storytelling =
    Pictographic Language +
    Workshop Format

    View Slide

  35. @hschwentner
    The Workshop Format

    View Slide

  36. @hschwentner
    Bring together
    the right people and
    let them tell a story

    View Slide

  37. View Slide

  38. View Slide

  39. "
    "
    Storyteller
    Listeners

    View Slide

  40. View Slide

  41. View Slide

  42. @hschwentner
    HANDS OVER
    RISK MANAGER
    SALESPERSON
    TO
    CONTRACT
    PASSES ON
    “The salesperson passes on
    the contract to the risk
    manager”

    View Slide

  43. Active Listening

    View Slide

  44. CONCRETE STORIES VS.
    ABSTRACT PROCESSES

    View Slide

  45. @hschwentner
    The
    Pictographic
    Language

    View Slide

  46. @hschwentner
    actor work object activity
    5
    sequence
    number

    View Slide

  47. @hschwentner
    risk
    manager
    contract votes

    View Slide

  48. @hschwentner
    CALCULATES
    GIVES
    INSTALLMENT
    CAR

    View Slide

  49. @hschwentner
    CONTRACT
    CONTRACT
    PASSES ON
    SIGNS

    View Slide

  50. @hschwentner
    person group IT system

    View Slide

  51. ACTORS ONCE/
    WORK OBJECTS SEVERAL TIMES
    SIGNS
    4
    FILLS OUT
    5
    CUSTOMER
    CONTRACT
    CONTRACT

    View Slide

  52. @hschwentner
    ßDraw here
    Leave some empty space there à
    Annotations,
    variations, and
    purpose
    Precondi?ons,
    assump?ons, and
    triggers
    Name of the Domain Story

    View Slide

  53. PICTOGRAPHIC LANGUAGE –
    NO IF/SWITCH/OR
    actor work object activity
    5
    sequence
    number

    View Slide

  54. Scenario-based
    modeling

    View Slide

  55. Scenarios
    Car Leasing – The Happy Path
    Car Leasing – Contract is too risky
    Car Leasing – Customer can’t afford installment

    View Slide

  56. @hschwentner
    Scope

    View Slide

  57. Scope Factors

    View Slide

  58. @hschwentner
    Granularity
    Point in time
    Domain Purity

    View Slide

  59. @hschwentner
    Granularity
    fine-
    grained
    coarse-
    grained
    x
    x
    x
    x
    x
    x
    x
    x
    x
    x
    x
    x
    x
    x
    x
    x
    x
    x

    View Slide

  60. @hschwentner
    A Day at the Beach
    ! Sea Level
    " Kite Level
    ☁ Cloud Level
    $ Fish Level
    % Clam Level
    Foto: Dennis Hamilton/flickr/CC BY 2.0
    Alistair
    Cockburn

    View Slide

  61. @hschwentner
    Point in Time
    as-is to-be
    t

    View Slide

  62. @hschwentner
    Point in Time
    now optimized
    t
    with new
    system

    View Slide

  63. @hschwentner
    Domain Purity
    pure digitalized

    View Slide

  64. @hschwentner
    Excercise

    View Slide

  65. @hschwentner
    Tell domain story:
    - “Travel by train”
    - Coarse-grained
    - All together
    Exercise

    View Slide

  66. @hschwentner
    Tools

    View Slide

  67. PowerPoint
    Whiteboard Kit (www.domainstorytelling.org)

    View Slide

  68. @hschwentner
    https://egon.io

    View Slide

  69. PowerPoint
    Whiteboard Kit (www.domainstorytelling.org)

    View Slide

  70. Whiteboard Kit (www.domainstorytelling.org)

    View Slide

  71. View Slide

  72. View Slide

  73. View Slide

  74. @hschwentner

    View Slide

  75. @hschwentner
    Modes

    View Slide

  76. Moderated

    View Slide

  77. View Slide

  78. Co-op

    View Slide

  79. View Slide

  80. View Slide

  81. @hschwentner
    Tell domain story:
    - “Going to the movies”
    - Coarse-grained
    - In groups
    Exercise

    View Slide

  82. @hschwentner
    Purposes

    View Slide

  83. @hschwentner
    draw boundaries
    learn language
    work on
    requirements
    implement domain
    model
    find shadow IT …

    View Slide

  84. View Slide

  85. @hschwentner
    Learning Domain Language

    View Slide

  86. CUSTOMER
    TELLS WISH FOR
    1
    SALESPERSON
    SIGNS
    TO
    GIVES
    FOR
    CONTRACT
    3
    RISK MANAGER
    CONTRACT
    PASSES ON
    TO
    4
    CONTRACT
    VOTES
    CHECKS
    CALCULATES
    5
    6
    7
    CALCU-
    LATES
    TO
    8
    2
    CAR
    CREDIT
    RATING
    INSTALLMENT
    CAR
    RESALE
    VALUE
    CONTRACT
    INSTALLMENT:
    THE MONTHLY
    PAYMENT OF
    THE CUSTOMER

    View Slide

  87. @hschwentner
    Drawing Boundaries

    View Slide

  88. View Slide

  89. Bundesarchiv, Bild 173-1282 / Helmut J. Wolf / CC-BY-SA 3.0

    View Slide

  90. @hschwentner
    Scope:
    coarse-grained
    to-be (i.e. optimized)
    pure

    View Slide

  91. Which activities
    belong together
    (from an actor’s
    perspective)?

    View Slide

  92. CUSTOMER
    TELLS WISH
    FOR
    1
    SALESPERSON
    SIGNS
    TO
    GIVES
    FOR
    CONTRACT
    3
    RISK MANAGER
    CONTRACT
    PASSES ON
    TO
    4
    CONTRACT
    VO
    TES
    CHECKS
    CALCU
    LATES
    5
    6
    7
    CALCU-
    LATES
    TO
    8
    2
    CAR
    CREDIT
    RATING
    INSTALLMENT
    CAR
    RESALE
    VALUE
    CONTRACT
    SALES
    RISK ASSESSMENT

    View Slide

  93. CUSTOMER
    TELLS WISH
    FOR
    1
    SALESPERSON
    SIGNS
    TO
    GIVES
    FOR
    CONTRACT
    3
    RISK MANAGER
    CONTRACT
    PASSES ON
    TO
    4
    CONTRACT
    VO
    TES
    CHECKS
    CALCU
    LATES
    5
    6
    7
    CALCU-
    LATES
    TO
    8
    2
    CAR
    CREDIT
    RATING
    INSTALLMENT
    CAR
    RESALE
    VALUE
    CONTRACT
    SALES
    Group the sentences
    • Boundary around activites
    and work objects
    • Keep actors outside
    boundaries
    Give a name to the group
    RISK ASSESSMENT

    View Slide

  94. CUSTOMER
    TELLS WISH
    FOR
    1
    SALESPERSON
    SIGNS
    TO
    GIVES
    FOR
    CONTRACT
    3
    RISK MANAGER
    CONTRACT
    PASSES ON
    TO
    4
    CONTRACT
    VO
    TES
    CHECKS
    CALCU
    LATES
    5
    6
    7
    CALCU-
    LATES
    TO
    8
    2
    CAR
    CREDIT
    RATING
    INSTALLMENT
    CAR
    RESALE
    VALUE
    CONTRACT
    SALES
    RISK ASSESSMENT

    View Slide

  95. SALES
    RISK
    ASSESSMENT

    View Slide

  96. @hschwentner
    Naming Subdomains
    Express what is done
    Verbs turned into nouns
    Often: -ing-form
    Anti-pattern: name of work object
    as name for subdomain

    View Slide

  97. @hschwentner
    Naming Subdomains—
    Examples
    Price
    calculation
    Risk
    assess-
    ment
    Maneuver
    planning
    Customer
    Car
    Price
    Payment
    Car
    inspection

    View Slide

  98. Indicators:
    1) Actor produces result on their own
    2) One-way informa3) Different triggers
    (4) Acin the picture
    5) Difference in language
    6) Different use of the same thing
    Ask your
    domain experts!

    View Slide

  99. @hschwentner
    Draw Boundaries:
    - “Traveling by train”
    - All together
    Exercise

    View Slide

  100. @hschwentner
    Draw Boundaries:
    - “Going to the movies”
    - In groups
    Exercise

    View Slide

  101. @hschwentner
    From Coarse-Grained
    to Fine-Grained

    View Slide

  102. CUSTOMER
    TELLS WISH
    FOR
    1
    SALESPERSON
    SIGNS
    TO
    GIVES
    FOR
    CONTRACT
    3
    RISK MANAGER
    CONTRACT
    PASSES ON
    TO
    4
    CONTRACT
    VO
    TES
    CHECKS
    CALCU
    LATES
    5
    6
    7
    CALCU-
    LATES
    TO
    8
    2
    CAR
    CREDIT
    RATING
    INSTALLMENT
    CAR
    RESALE
    VALUE
    CONTRACT
    SALES
    RISK ASSESSMENT

    View Slide

  103. CUSTOMER
    TELLS WISH
    FOR
    1
    SALESPERSON
    SIGNS
    TO
    GIVES
    FOR
    CONTRACT
    3
    CALCU-
    LATES
    TO
    8
    2
    CAR
    INSTALLMENT
    CAR
    CONTRACT
    SALES
    salesperson
    fills out
    1
    contract
    car model
    w
    ith
    price
    and

    View Slide

  104. salesperson
    fills out
    1
    2
    interest
    from
    contract
    price
    car model
    calculates
    3
    offers
    installment
    signs
    w
    ith
    and
    contract
    for
    price
    and
    customer
    contract
    3

    View Slide

  105. @hschwentner
    Tell domain story:
    - “Validate train ticket”
    - Fine-grained
    - All together
    Exercise

    View Slide

  106. @hschwentner
    Tell domain story:
    - “Selling movie tickets”
    - Fine-grained,
    pure, as-is
    - In groups
    Exercise

    View Slide

  107. @hschwentner
    Working
    with
    Requirements

    View Slide

  108. @hschwentner
    From Domain Story
    to User Story

    View Slide

  109. SALESPERSON
    CUSTOMER
    TELLS WISH FOR
    1
    SIGNS
    TO
    GIVES
    FOR
    CONTRACT
    3
    RISK MANAGER
    CONTRACT
    PASSES ON
    TO
    4
    CONTRACT
    VOTES
    CHECKS
    CALCULATES
    5
    6
    7
    CALCU-
    LATES
    TO
    8
    2
    CAR
    CREDIT
    RATING
    INSTALLMENT
    CAR
    RESALE
    VALUE
    CONTRACT
    TELL WISH
    FOR CAR
    CALCULATE
    INSTALLMENT

    View Slide

  110. SALESPERSON
    CUSTOMER
    TELLS WISH FOR
    1
    SIGNS
    TO
    GIVES
    FOR
    CONTRACT
    3
    RISK MANAGER
    CONTRACT
    PASSES ON
    TO
    4
    CONTRACT
    VOTES
    CHECKS
    CALCULATES
    5
    6
    7
    CALCU-
    LATES
    TO
    8
    2
    CAR
    CREDIT
    RATING
    INSTALLMENT
    CAR
    RESALE
    VALUE
    CONTRACT
    AS CUSTOMER I WANT
    TO TELL WHAT KIND
    OF CAR I NEED SO
    THAT THE CAR IS NOT
    TOO EXPENSIVE
    AS SALESPERSON I
    WANT TO CALCULATE
    THE CONTRACT SO
    THAT I CAN FULFILL
    MY CLIENT‘S WISH

    View Slide

  111. @hschwentner
    From Domain Story
    to User Story Map

    View Slide

  112. @hschwentner
    Coarse-Grained Domain Story
    as
    Backbone for
    User Story Map

    View Slide

  113. View Slide

  114. @hschwentner
    TELL WISH
    FOR CAR
    CALCULATE
    INSTALLMENT
    SIGN
    CONTRACT
    PASS ON
    CONTRACT

    View Slide

  115. @hschwentner
    WISH
    CAR
    CALCULATE
    INSTALLMENT
    SIGN
    CONTRACT
    PASS O
    CONTRA
    CALCULATE
    INSTALLMENT
    FOR NEW
    CUSTOMER
    CALCULATE
    INSTALLMENT
    FOR EXISTING
    CUSTOMER

    View Slide

  116. @hschwentner
    Write user stories:
    - “Selling movie tickets”
    - In groups
    Exercise

    View Slide

  117. @hschwentner
    Modeling in Code

    View Slide

  118. salesperson
    fills out
    1
    2
    interest
    from
    contract
    price
    car model
    calculates
    3
    offers
    installment
    signs
    w
    ith
    and
    contract
    for
    price
    and
    customer
    contract
    3

    View Slide

  119. @hschwentner
    How do we design a
    program for that?

    View Slide

  120. View Slide

  121. @hschwentner
    #dddesign

    View Slide

  122. -DRIVEN DESIGN

    View Slide

  123. Software
    Domain

    View Slide

  124. View Slide

  125. View Slide

  126. View Slide

  127. @hschwentner
    From Domain Story to Code

    View Slide

  128. «Entity»
    Contract
    fillOut(:CarModel, :Price)
    calculateInstallment(:Interest)
    salesperson
    fills out
    1
    2
    interest
    from
    contract
    price
    car model
    calculates
    3
    offers
    installment
    signs
    w
    ith
    and
    contract
    for
    price
    and
    customer
    contract
    3
    sign()

    View Slide

  129. «En>ty»
    Contract
    fillOut(:CarModel, :Price)
    calculateInstallment(:Interest)
    sign()
    «Value Object»
    CarModel «Value Object»
    Price
    «Value Object»
    Interest

    View Slide

  130. class Contract {
    public Contract(CarModel carModel, Amount price)
    //...
    public void calculateInstallment(Interest interest)
    //...
    public void sign(SignDate date)
    //...
    }

    View Slide

  131. import org.jmolecules.annotations.ddd.Entity;
    @Entity
    class Contract {
    public Contract(CarModel carModel, Amount price)
    //...
    public void calculateInstallment(Interest interest)
    //...
    public void sign(SignDate date)
    //...
    }

    View Slide

  132. import org.jmolecules.annotations.ddd.Entity;
    @Entity
    class Contract {
    public Contract(CarModel carModel, Amount price)
    //...
    public void calculateInstallment(Interest interest)
    //...
    public void sign(SignDate date)
    //...
    }
    record CarModel(String name){}

    View Slide

  133. import org.jmolecules.annotations.ddd.*;
    @Entity
    class Contract {
    public Contract(CarModel carModel, Amount price)
    //...
    public void calculateInstallment(Interest interest)
    //...
    public void sign(SignDate date)
    //...
    }
    @ValueObject
    record CarModel(String name){}

    View Slide

  134. @Entity
    class Contract {
    public Contract(CarModel carModel, Amount price)
    //...
    public void calculateInstallment(Interest interest)
    //...
    public void sign(SignDate date)
    //...
    }
    @ValueObject
    record CarModel(String name){}
    @ValueObject
    record Amount(int cents, Currency currency){}
    @ValueObject
    enum Currency{ EUR, GBP, USD }

    View Slide

  135. public void sign(SignDate date)
    //...
    }
    @ValueObject
    record CarModel(String name){}
    @ValueObject
    record Amount(int cents, Currency currency){}
    @ValueObject
    enum Currency{ EUR, GBP, USD }
    // ...

    View Slide

  136. Object orientation

    View Slide

  137. LeasingNinja
    https://leasingninja.io

    View Slide

  138. @hschwentner
    LeasingNinja.io

    View Slide

  139. @hschwentner
    Derive Domain Model:
    - “Traveling by train”
    - From fine-grained
    stories
    - All together
    Exercise

    View Slide

  140. @hschwentner
    Derive Domain Model:
    - “Going to the movies”
    - From fine-grained
    stories
    - In groups
    Exercise

    View Slide

  141. @hschwentner
    Cutting the Monolith

    View Slide

  142. @hschwentner
    Brownfield

    View Slide

  143. @hschwentner
    How to split the monolith

    View Slide

  144. 1) How should it be?
    2) How is it?
    3) How to move the “is” to the “ideal”?
    RISK
    MANAGE-
    MENT
    SALES

    View Slide

  145. 1) How should it be?
    1) Domain Re-Discovery
    2) “ideal” context map
    2) How is it?
    1) Architecture Analysis
    2) As-is context map
    3) How to move the “is” to the “ideal”?
    1) Compare
    2) Create List of Refactorings
    4) Do the move
    1) Extract a suppor2) Then extract core(s)

    View Slide

  146. old old old old
    new
    new new new
    “just flip
    the lever”
    1 2 3 4 5
    a.k.a.
    big bang
    replacement

    View Slide

  147. old old old
    new
    new new new
    2 3 4 5
    old
    1

    View Slide

  148. Strangler
    Fig
    Application

    View Slide

  149. Strangler Fig Application

    View Slide

  150. Lesson:
    is better than
    Strangler Fig
    Application
    Big Bang
    Replacement

    View Slide

  151. <>
    Contract
    sign()
    SALES
    RISK
    ASSESSMENT
    <>
    Contract
    sign()
    vote()

    BIG BALL
    OF MUD
    <>
    Contract
    vote()

    View Slide

  152. Domain-Driven
    Refactorings
    • Strategic
    • Socio-Technical
    • Tactical (Against Model Anemia)
    • Tactical (Against Big Ball of Mud)

    View Slide

  153. Domain-Driven
    Refactorings
    • Strategic
    • Carve Out Bounded Context
    • Socio-Technical
    • Form Cross-Functional Team
    • Tactical (Against Model Anemia)
    • Tactical (Against Big Ball of Mud)
    • Extract Specialized Entity
    • Extract Specialized Data Model

    View Slide

  154. Read on at:
    https://hschwentner.io/domain-driven-refactorings

    View Slide

  155. View Slide

  156. @hschwentner
    Consulting

    View Slide

  157. View Slide

  158. @hschwentner
    Conclusion

    View Slide

  159. @hschwentner
    Further Reading

    View Slide

  160. @hschwentner
    https://domainstorytelling.org

    View Slide

  161. Get it at:
    https://hschwentner.io

    View Slide

  162. @hschwentner
    LeasingNinja.io

    View Slide

  163. May 6th-8th 2024
    Vienna, Austria
    The Collaborative Modeling Unconference
    comocamp.org
    Event Storming
    User Story Mapping
    Event Modeling
    Impact Mapping
    Domain Storytelling
    Storystorming
    Context Mapping
    Example Mapping
    etc.

    View Slide

  164. View Slide

  165. View Slide

  166. @hschwentner

    View Slide

  167. View Slide

  168. View Slide

  169. Bibliography
    Baas-Schwegler, Kenny and João Rosa (eds.). Visual Collaboration Tools. Self-published, Leanpub, last updated
    August 7, 2020.
    Beck, Kent et al. Manifesto for Agile Software Development. 2001.
    Brandolini, Alberto. Introducing EventStorming. Self-published, Leanpub, last updated February 12, 2021.
    Conway, Melvin E. “How Do Committees Invent?” Datamation 14, no. 5 (April 1968): 28–31.
    Evans, Eric. Domain-Driven Design: Tackling Complexity in the Heart of Software. Boston: Addison-Wesley, 2004.
    Foote, Brian and Joseph Yoder. “Big Ball of Mud.” PLoP ’97, Monticello, IL, September 1997.
    Fowler, Martin. “Strangler Fig Application.” Bliki, June 29, 2004.
    Hofer, Stefan and Henning Schwentner. Domain Storytelling: a Collaborative, Visual, and Agile Way to Develop Domain-
    Driven Software. Boston: Addison-Wesley, 2022.
    Patton, Jeff. User Story Mapping: Discover the Whole Story, Build the Right Product. Sebastopol, CA: O’Reilly, 2014.

    View Slide

  170. View Slide

  171. Henning Schwentner
    ⌂ https://hschwentner.io
    @hschwentner
    [email protected]
    Kolleg:in gesucht
    (Deutschlandweit)

    View Slide

  172. @hschwentner
    Appendix

    View Slide

  173. @hschwentner
    What about Event Storming?

    View Slide

  174. View Slide

  175. View Slide

  176. View Slide