- Domain modelling involves creating models of a domain using the language of that domain. Any description or documentation of a domain is a form of modelling.
- It is important to divide domain models into separate bounded contexts defined by consistent use of language within each context. This reduces complexity.
- An effective domain model uses terminology from the domain itself rather than technical language, and the model language can be expanded creatively as long as new terms are shared with domain experts.
9. Modelling
Model is built with LANGUAGE
always interpretation
implicit meaning, e.g. “capacity” of a basket
10. Modelling
Model is built with LANGUAGE
always interpretation
implicit meaning, e.g. “capacity” of a basket
ANY description of a domain is modelling!
Solution is limited by description of the problem
What you SAY is what you get
11. Language & world view
linguistic relativity
Sapir-Whorf hypothesis
language can have (some) effect on thought
13. Example: no future tense:
Keith Chen’s investigation of saving behaviour
Example:
different colors
Language & world view
linguistic relativity
Sapir-Whorf hypothesis
language can have (some) effect on thought
15. John McWhorter:
• Tiny differences: different world-view??
• Language features ramdomly distributed
• Questionable classification of languages
• Discrimination
Criticism of Whorfianism
Noam Chomsky: universal grammar
16. John McWhorter:
• Tiny differences: different world-view??
• Language features ramdomly distributed
• Questionable classification of languages
• Discrimination
Culture demonstrates our diversity.
Language demonstrates our similarity.
Criticism of Whorfianism
Noam Chomsky: universal grammar
17. Different words...
words slice the world into tiny pieces
different domain: different words (jargon)
or: what’s left of the Sapir-Whorf hypothesis
18. example: foreign keys – “customer knows this”
getting to know the customer’s domain!
morning flight - evening flight
use language of the domain
not a technical language as “template” over the domain
20. Modelling = philosophy
... and vice versa
Philosophers have been modelling for ages
Their domain being not a particular domain,
but everything in general: “the world”, “the universe”.
The world is everything that is the case.
(Die Welt ist alles, was der Fall ist)
Wittgenstein, Tractatus logico-philosophicus, 1918
Picture-theory of language
21. Modelling = philosophy
... and vice versa
Aristotle
(4th century BC)
categorise, types of “being”
substance (exists on its own) versus accidentals (attributes, properties)
22. Modelling = philosophy
... and vice versa
Aristotle
(4th century BC)
categorise, types of “being”
substance (exists on its own) versus accidentals (attributes, properties)
value
redness of something;
a “value” doesn’t exist on its own.
23. Modelling = philosophy
... and vice versa
Aristotle
(4th century BC)
categorise, types of “being”
substance (exists on its own) versus accidentals (attributes, properties)
part - whole
invoice – invoicelines
(aggregation <> composition)
value
redness of something;
a “value” doesn’t exist on its own.
24. Modelling = philosophy
... and vice versa
Ockham
(14th century)
simplificate; not more entities than necessary
RAZOR
25. Modelling = philosophy
... and vice versa
BUT: Newton
(1643 - 1727)
TIME as extra entity,
which was useful
26. Modelling = philosophy
... and vice versa
BUT: Newton
(1643 - 1727)
TIME as extra entity,
which was useful
<>Leibniz
(1646 - 1716)
27. Modelling = philosophy
... and vice versa
BUT: Newton
(1643 - 1727)
TIME as extra entity,
which was useful
<>Leibniz
(1646 - 1716)
Time & space as an a priori idea
=> interpretation, implicitness.
=> Kant
(1724 - 1804)
28. Category Mistake
Gilbert Ryle
The Concept of Mind, 1949
Critique of “the Carthesian myth”:
mind & body as 2 entities:
the dogma of the “ghost in the machine”.
It is a logical error: a category mistake.
34. Category Mistake
things or facts of one kind are presented
as if they belong to another
invoice and invoicelines
entity or value object
In class diagrams, ERDs and relational calculus everything is a class, entity or tuple (table).
No categories => category-mistakes are easily introduced and overlooked!
35. Category Mistake
things or facts of one kind are presented
as if they belong to another
Country and borders
(and the borders of those borders
and the borders of those borders
of those borders ad infinitam)
36. Bounded Context
In Domain Driven Design the boundaries of a model are called a
They treat bounded contexts like the borders of a country.
And talk about the boundaries of that bounded context...
country and its borders: category mistake!
37. Bounded Context
A model is bounded by language consistency.
The boundaries of a model are called a Bounded Context.
A Bounded Context is bounded (duh!) by language consistency.
Ockham’s razor: model == Bounded Context
38. Bounded Context
Different MEANING of same word in another context
example: “customer”
divide & conquer - separate models
Example bounded contexts:
• flight planning
• booking
• payment, accounting
• crew planning
think inside a box
Very good principle to divide in separate models!!!
Reduces complexity
39. • different computer language?? No: “language” = metaphore
• other metaphore: tool (Alvaro Videla) .
• a programming language is parasitic (Umberto Eco)
different language ⇒ different model
What do you mean by different language?
40. • different computer language?? No: “language” = metaphore
• different natural language?? No, MEANING should be the same
model should not be “lost in translation”
different language ⇒ different model
What do you mean by different language?
41. • different computer language?? No: “language” = metaphore
• different natural language?? No, MEANING should be the same
• different paradigm?? No: MEANING is the same
• Example:
• structural 1:n reservation (CRUD)
• vs temporal / Event Sourcing: reserved & cancelled events
other implementation, not other meaning
different language ⇒ different model
What do you mean by different language?
45. Wittgenstein
the limits of language
Whereof one cannot speak, thereof one must be silent.
(Wovon man nicht sprechen kann, darüber muss man schweigen)
49. expanding the language
specific language that is used in a domain
JARGON = language that is already expanded for a specific domain!
50. expanding the language
specific language that is used in a domain
JARGON = language that is already expanded for a specific domain!
creative
ADD new words to the model language
SHARE those new words with the domain experts
51. expanding the language
specific language that is used in a domain
JARGON = language that is already expanded for a specific domain!
creative
ADD new words to the model language
SHARE those new words with the domain experts
freedom
no excess entities (Occam)
but you can add “extra” entities, like time; if USEFUL.
54. domain modelling
• use words from the domain
• avoid technical language
• divide in separate models with consistency of MEANING
55. domain modelling
• use words from the domain
• avoid technical language
• divide in separate models with consistency of MEANING
• model-language is expandable
56. domain modelling
• use words from the domain
• avoid technical language
• divide in separate models with consistency of MEANING
• model-language is expandable
• freedom to not let model correspond 1:1 with domain
57. domain modelling
• use words from the domain
• avoid technical language
• divide in separate models with consistency of MEANING
• model-language is expandable
• freedom to not let model correspond 1:1 with domain
• document the model
60. what about ... the world?
environment & ethics
Average ballloon flight 50 litres propane gas
= about 1000 km car drive.
61. what about ... the world?
environment & ethics
Average ballloon flight 50 litres propane gas
= about 1000 km car drive.
Dilemma:
romantic activity, giving something extra to life,
versus not good for the whole planet.
62. what about ... the world?
environment & ethics
Average ballloon flight 50 litres propane gas
= about 1000 km car drive.
Dilemma:
romantic activity, giving something extra to life,
versus not good for the whole planet.
Developers have a responsibility:
do I agree with the business I work for?
All in all you’re just
another brick in the wall