The Eric Normand Podcast

When do we want to refer to things by name?

4 snips
Oct 17, 2022
Dive into the intriguing world of domain modeling! Discover when to name entities versus nesting subcomponents, all explained through the delicious lens of pizza ingredients. Ownership and data relationships play a crucial role in effective object-oriented programming. Get ready to enhance your modeling skills and understand the delicate balance between clarity and complexity!
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ANECDOTE

Pizza Toppings as Domain Modeling Example

  • Eric Normand uses ordering a pizza with toppings to illustrate domain modeling decisions about naming versus nesting data.
  • He contrasts including full topping details in pizza data versus simply naming toppings and using external lookups.
INSIGHT

Ownership Clarifies Data Location

  • Naming the topping with a string and having price data elsewhere reflects ownership separation in domain modeling.
  • The pizza and customer context do not own topping prices; the business does, so price belongs in a separate model.
INSIGHT

Object-Oriented Model Challenges

  • Mainstream object-oriented programming encourages representing toppings as objects with methods, which complicates data ownership and modeling.
  • Methods like 'set price' raise questions about whether changes apply globally or per instance, often left ambiguous.
Get the Snipd Podcast app to discover more snips from this episode
Get the app