modelling heuristics

54
Modelling Heuristics @mathiasverraes

Upload: mathias-verraes

Post on 08-Jul-2015

124 views

Category:

Software


2 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Modelling Heuristics

Modelling Heuristics@mathiasverraes

Page 2: Modelling Heuristics

Mathias Verraes

Independent ConsultantValue Object Comm.V

Student of SystemsMeddler of ModelsLabourer of Legacy

verraes.net

Page 3: Modelling Heuristics

Is modelling a learnable skill?

Page 4: Modelling Heuristics

The pain of awrong abstraction

Page 5: Modelling Heuristics

Upfront Model? 1

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

Page 6: Modelling Heuristics

You are always making

mental models

Page 7: Modelling Heuristics

Analysis model 2vs

Domain model

2 Martin Fowler, 1996, "Analysis Patterns: Reusable Object Models"

Page 8: Modelling Heuristics

Heuristic

Domain Language

Page 9: Modelling Heuristics

Linguistic RelativismSapir-Whorf Hypothesis 3,4

4 Paul Graham, "Beating the Averages", http://www.paulgraham.com/avg.html

3 Steven Pinker, 1994, "The Language Instinct"

Page 10: Modelling Heuristics

Heuristic

Find the NounsAnti-pattern?

Page 11: Modelling Heuristics

Heuristic

Descriptive vs InfluentialProperties

Page 12: Modelling Heuristics

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

Page 13: Modelling Heuristics

Heuristic

Static / Dynamic

Page 14: Modelling Heuristics

Heuristic

Find the VerbsCommands

Page 15: Modelling Heuristics

Verb-based:

f = chain( breakTextIntoWords() : [String] groupWordsIntoLines() : [[String]] joinWordsInBrokenLines() : [String] joinBrokenLines() : String)

f("A long paragraph") -> "A long\nparagraph"

Page 16: Modelling Heuristics

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

Page 17: Modelling Heuristics

Heuristic

Find the SentencesFind the Idioms

Page 18: Modelling Heuristics

Heuristic

Find the Scenarios

Page 19: Modelling Heuristics

Given I have a productWhen I look at the price of a product ...

or

Given I have a productWhen I lookup the product in the pricing table ...

?

Page 20: Modelling Heuristics

Remember, you are alwaysmaking mental models

Page 21: Modelling Heuristics

As a customer I want to ...

Given there is a productWhen I look at the price of a product ...

As a shop owner I want to ...

Given I have a productWhen I lookup the product in the pricing table ...

Page 22: Modelling Heuristics

Heuristic

Actors and Roles

Page 23: Modelling Heuristics

Heuristic

The Worker and the Beneficiary

Page 24: Modelling Heuristics

When I look at the price of a product ...

When I lookup the product in the pricing table ...

Page 25: Modelling Heuristics

HeuristicSegregating

Reading and Writing

Page 26: Modelling Heuristics

Heuristic

BeingBehavingBecoming

Three B's 5

5 Gerald M. Weinberg, 1988, "Rethinking Systems Analysis and Design"

Page 27: Modelling Heuristics

The customer sometimes has an email.

Missing concept?

Page 28: Modelling Heuristics

HeuristicCollaborative Construction6

ExecutionTracking

aka Planning/Execution/Analysis

6 Cyrille Martraire, "Collaborative Construction by Alberto Brandolini", http://cyrille.martraire.com/2012/09/collaborative-construction-by-alberto-brandolini/

Page 29: Modelling Heuristics

Heuristic

Domain Events8

8 http://verraes.net/2014/11/domain-events/

Page 30: Modelling Heuristics

Time ->

Page 31: Modelling Heuristics

Heuristic

Cause & Consequence

Page 32: Modelling Heuristics
Page 33: Modelling Heuristics

Cause & Consequence

HumanExternal system

ProcessTime

Page 34: Modelling Heuristics

Heuristic

Business RulesReasons for failure

Page 35: Modelling Heuristics
Page 36: Modelling Heuristics

Heuristic

Consistency Boundary

Page 37: Modelling Heuristics
Page 38: Modelling Heuristics
Page 39: Modelling Heuristics

Heuristic

Entity Inclusion

Page 40: Modelling Heuristics
Page 41: Modelling Heuristics

Heuristic

Temporal Expansion

Page 42: Modelling Heuristics
Page 43: Modelling Heuristics

Heuristic

Temporal Shift

Page 44: Modelling Heuristics
Page 45: Modelling Heuristics

Heuristic

Invariant Inclusion

Page 46: Modelling Heuristics
Page 47: Modelling Heuristics

Heuristic

Conceptual Shift

Page 48: Modelling Heuristics
Page 49: Modelling Heuristics

Heuristic

Crossing Streams

Page 50: Modelling Heuristics
Page 51: Modelling Heuristics

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/

Page 52: Modelling Heuristics

FormalInformalAformal

Page 53: Modelling Heuristics

Throw Away the Model

Page 54: Modelling Heuristics

@mathiasverraesverraes.net

Workshops Domain-Driven Design

verraes.net/workshops

Ghent, Belgium, January 20-22Newcastle, UK (TBC)