Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are trying to do domain-driven design don't start with tables. Elaborate first a conceptual model that reflects your underlying domain. I agree with ndp: RecipeIngredient is a bit of an awkward name/concept, from a DDD perspective.</p> <p>I think the model needs the following concepts: Recipe, Ingredient, Measure and RecipePreparation. </p> <p>A Recipe is an aggregation of Ingredients. Each Ingredient belonging to a Recipe need a Measure associated to it, as a specification for the preparation. Also you need to model the RecipePreparation to associate the actual quantity of each ingredient used during a specific preparation of the recipe. </p> <p>A Measure consists of unit and amount (e.g. 2 cups, 0.5 oz, 250 gr, 2 tbsp...).</p> <p>I see here two different things that could be mixed during analysis and should be kept split: Recipe/Ingredient/Measure as a specification in order to cook something (one instance for each recipe) and RecipePreparation/Ingredient/Measure as a concrete preparation of one recipe, done by a specific person on a specific moment, and may be using different measures (doubled all the ingredients because the recipe specification is for two plates and you have four guests... something like that).</p> <p>You can go deeper and start modeling things like some ingredients having a set of exchangeable ingredients (e.g. if you don't have goat's cheese use mozzarella), a cookbook that collect a set of recipes of the same category, a cooking time for the recipe, etc.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload