Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Cut & Shave

43 views

Published on

Presentation about Domain Modelling (and language / philosophy) on https://kandddinsky.de/ Berlin 2019,October 18

In mister Occam's barbershop we'll have Domain Modelling in our chair to have a fresh cut and shave. We'll cut, redefine, rename and rearrange concepts like bounded contexts, ubiquitous language, context maps, aggregates and their roots, entities, value objects and event sourcing. Our modeling tools have grown, but might need some maintenance service... Language is the vehicle of modeling, it is the tool by which we understand the world. Our words are the building blocks of our models. If our language is imprecise, inconsistent or contradictory, so our models will be imprecise, inconsistent or contradictory. Although some practicioners of Domain Driven Design proudly call themselves “domain linguists”, not all DDD-jargon is very well defined. Some concepts come from different paradigms or contain logical errors. Too broad or too narrow definitions introduce unnecessary accidental complexity. This presentation aims to show some mistakes and do proposals to improve the situation. The proof of the pudding is to show how models can be made more useful by that. On our road we'll be helped by some modelers from the past, like Aristotle, Hume, Kant, Wittgenstein or Ryle. And we'll see how a 14th century razor blade can still be sharp.

Creative developer Herman Peeren likes creativity and exploring new ideas. Modelling is a way to better understand the world around us. Computer Science is Philosophy. Languages carry our thoughts, and that holds for both natural languages and computer languages.

Resources & links can be found on http://hermanpeeren.nl/

Published in: Software
  • Be the first to comment

  • Be the first to like this

Cut & Shave

  1. 1. Cut & Shave Domain Modelling Herman Peeren October 2019
  2. 2. Cut & Shave Domain Modelling
  3. 3. Cut & Shave Domain Modelling
  4. 4. Domain & model Balloon - capacity Planned Flight - date, departure place Passengers Tickets - buying, paying (Re)Reservations Gift-tickets Crew - Skills Car - driving license →
  5. 5. Domain & image in math
  6. 6. Domain & image / picture / model →
  7. 7. Domain & model
  8. 8. domain → model abstraction domain ← model e.g. new product design model = example Domain & model
  9. 9. Modelling Model is built with LANGUAGE always interpretation implicit meaning, e.g. “capacity” of a basket
  10. 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. 11. Language & world view linguistic relativity Sapir-Whorf hypothesis language can have (some) effect on thought
  12. 12. Example: different colors Language & world view linguistic relativity Sapir-Whorf hypothesis language can have (some) effect on thought
  13. 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
  14. 14. Criticism of Whorfianism Noam Chomsky: universal grammar
  15. 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. 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. 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. 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
  19. 19. ERD - class diagram - entities - structure Accidental complexity
  20. 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. 21. Modelling = philosophy ... and vice versa Aristotle (4th century BC) categorise, types of “being” substance (exists on its own) versus accidentals (attributes, properties)
  22. 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. 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. 24. Modelling = philosophy ... and vice versa Ockham (14th century) simplificate; not more entities than necessary RAZOR
  25. 25. Modelling = philosophy ... and vice versa BUT: Newton (1643 - 1727) TIME as extra entity, which was useful
  26. 26. Modelling = philosophy ... and vice versa BUT: Newton (1643 - 1727) TIME as extra entity, which was useful <>Leibniz (1646 - 1716)
  27. 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. 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.
  29. 29. Category Mistake Oxford: colleges, libraries, playing fields, scientific departments, administrative offices, etc.
  30. 30. Category Mistake Oxford: colleges, libraries, playing fields, scientific departments, administrative offices, etc. But where is the University?
  31. 31. Category Mistake Cricket: bowlers, batsmen, fielders, umpirers, scorers.
  32. 32. Category Mistake Cricket: bowlers, batsmen, fielders, umpirers, scorers. But where is the team-spirit?
  33. 33. Category Mistake things or facts of one kind are presented as if they belong to another
  34. 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. 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. 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. 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. 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. 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. 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. 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?
  42. 42. Bounded Context different language ⇒ different model Document the model! Code can document the model, but is not read by the business
  43. 43. Ubiquitous language = model language
  44. 44. Wittgenstein the limits of language Whereof one cannot speak, thereof one must be silent. (Wovon man nicht sprechen kann, darüber muss man schweigen)
  45. 45. Escape? Creativity! Expanding the limits of language is possible (Gödel) Expressing beyond the limits of language is Art We shape our world by modelling
  46. 46. expanding the language
  47. 47. expanding the language specific language that is used in a domain JARGON = language that is already expanded for a specific domain!
  48. 48. 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
  49. 49. 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.
  50. 50. domain modelling • use words from the domain
  51. 51. domain modelling • use words from the domain • avoid technical language
  52. 52. domain modelling • use words from the domain • avoid technical language • divide in separate models with consistency of MEANING
  53. 53. domain modelling • use words from the domain • avoid technical language • divide in separate models with consistency of MEANING • model-language is expandable
  54. 54. 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
  55. 55. 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
  56. 56. epilogue: girl power
  57. 57. what about ... the world? environment & ethics Average ballloon flight 50 litres propane gas = about 1000 km car drive.
  58. 58. 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.
  59. 59. 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
  60. 60. Thank you! hermanpeeren.nl herman@yepr.nl @HermanPeeren slideshare.net/HermanPeeren

×