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

Modelling Heuristics

Modelling Heuristics

http://verraes.net

“How do you approach software modelling problems?”
When a client asked me about my mental process, I didn’t have a proper answer — yet. The question intrigued me. Do you need a propensity for modelling, or is it a learnable skill? I embarked on a mission to find modelling heuristics: the mental tools, that help us look at the problem from different angles; the little tricks to validate a model before we build it; the rules of thumb that lead us to iteratively refine our solutions. In this talk, I share some of the ideas I collected from books, from people I interviewed, and from my own experiences.

--

Mathias Verraes is a recovering music composer turned programmer, consultant, blogger, and speaker. He advises companies on how to build enterprise web applications for complex business domains. For some weird reason, he enjoys working on large legacy projects: the kind where there’s half a million lines of spaghetti code, and nobody knows how to get the codebase under control. He’s the founder of the Domain-Driven Design Belgium community. When he’s not working, he’s at home in Kortrijk, Belgium, helping his two sons build crazy Lego train tracks.

Mathias Verraes

November 20, 2014
Tweet

More Decks by Mathias Verraes

Other Decks in Technology

Transcript

  1. Modelling Heuristics
    @mathiasverraes

    View Slide

  2. Mathias
    Verraes
    Independent Consultant
    Value Object Comm.V
    Student of Systems
    Meddler of Models
    Labourer of Legacy
    verraes.net

    View Slide

  3. Is modelling a
    learnable skill?

    View Slide

  4. The pain of a
    wrong abstraction

    View Slide

  5. Upfront Model? 1
    1 Scott W. Ambler, "Big Modeling Up Front (BMUF) Anti-Pattern", http://www.agilemodeling.com/
    essays/bmuf.htm

    View Slide

  6. You are always making
    mental models

    View Slide

  7. Analysis model 2
    vs
    Domain model
    2 Martin Fowler, 1996, "Analysis Patterns: Reusable Object Models"

    View Slide

  8. Heuristic
    Domain
    Language

    View Slide

  9. Linguistic
    Relativism
    Sapir-Whorf Hypothesis 3,4
    4 Paul Graham, "Beating the Averages", http://www.paulgraham.com/avg.html
    3 Steven Pinker, 1994, "The Language Instinct"

    View Slide

  10. Heuristic
    Find the Nouns
    Anti-pattern?

    View Slide

  11. Heuristic
    Descriptive vs Influential
    Properties

    View Slide

  12. [ {
    "licensePlate": "1-ABC-123",
    "brand": "BMW",
    "make": "X1",
    "color": "Aggregate Blue",
    ...,
    "location": "40.7127837,-74.0059413"
    },
    ...
    ]

    View Slide

  13. Heuristic
    Static / Dynamic

    View Slide

  14. Heuristic
    Find the Verbs
    Commands

    View Slide

  15. Verb-based:
    f = chain(
    breakTextIntoWords() : [String]
    groupWordsIntoLines() : [[String]]
    joinWordsInBrokenLines() : [String]
    joinBrokenLines() : String
    )
    f("A long paragraph") -> "A long\nparagraph"

    View Slide

  16. Noun-based: 7
    f = chain(
    words() : [String]
    brokenLines() : [[String]]
    wordJoinedLines() : [String]
    joinedLines() : String
    )
    f("A long paragraph") -> "A long\nparagraph"
    7 Michael Feathers, "A Type Driven Approach to Functional Design", InfoQ

    View Slide

  17. Heuristic
    Find the Sentences
    Find the Idioms

    View Slide

  18. Heuristic
    Find the Scenarios

    View Slide

  19. Given I have a product
    When I look at the price of a product ...
    or
    Given I have a product
    When I lookup the product in the pricing table ...
    ?

    View Slide

  20. Remember, you are always
    making mental models

    View Slide

  21. As a customer I want to ...
    Given there is a product
    When I look at the price of a product ...
    As a shop owner I want to ...
    Given I have a product
    When I lookup the product in the pricing table ...

    View Slide

  22. Heuristic
    Actors and Roles

    View Slide

  23. Heuristic
    The Worker and
    the Beneficiary

    View Slide

  24. When I look at the price of a product ...
    When I lookup the product in the pricing table ...

    View Slide

  25. Heuristic
    Segregating
    Reading and Writing

    View Slide

  26. Heuristic
    Being
    Behaving
    Becoming
    Three B's 5
    5 Gerald M. Weinberg, 1988, "Rethinking Systems Analysis and Design"

    View Slide

  27. The customer sometimes has an email.
    Missing concept?

    View Slide

  28. Heuristic
    Collaborative Construction6
    Execution
    Tracking
    aka Planning/Execution/Analysis
    6 Cyrille Martraire, "Collaborative Construction by Alberto Brandolini", http://
    cyrille.martraire.com/2012/09/collaborative-construction-by-alberto-brandolini/

    View Slide

  29. Heuristic
    Domain Events8
    8 http://verraes.net/2014/11/domain-events/

    View Slide

  30. Time ->

    View Slide

  31. Heuristic
    Cause &
    Consequence

    View Slide

  32. View Slide

  33. Cause & Consequence
    Human
    External system
    Process
    Time

    View Slide

  34. Heuristic
    Business Rules
    Reasons for failure

    View Slide

  35. View Slide

  36. Heuristic
    Consistency
    Boundary

    View Slide

  37. View Slide

  38. View Slide

  39. Heuristic
    Entity Inclusion

    View Slide

  40. View Slide

  41. Heuristic
    Temporal Expansion

    View Slide

  42. View Slide

  43. Heuristic
    Temporal Shift

    View Slide

  44. View Slide

  45. Heuristic
    Invariant Inclusion

    View Slide

  46. View Slide

  47. Heuristic
    Conceptual Shift

    View Slide

  48. View Slide

  49. Heuristic
    Crossing Streams

    View Slide

  50. View Slide

  51. Heuristic
    Happy Path /
    Divergent Path9
    9 Mathias Verraes, "Event Storming: on Fake Domains and Happy Paths", http://verraes.net/
    2014/07/event-storming-fake-domains-happy-paths/

    View Slide

  52. Formal
    Informal
    Aformal

    View Slide

  53. Throw Away the Model

    View Slide

  54. @mathiasverraes
    verraes.net
    Workshops Domain-Driven Design
    verraes.net/workshops
    Ghent, Belgium, January 20-22
    Newcastle, UK (TBC)

    View Slide