2009-11-21 135 views
0

爲了更好地學習可可和核心數據,我決定構建一個包含烹飪食譜的應用程序。但是,在嘗試創建CD模型時,我已經陷入困境。核心數據關係屬性

這三個類的,簡化:

Recipe: 
name 
ingredients 
instructions 

Ingredient: 
name 
unit (liter, teaspoon etc) 

當然,在配方的成分也關係需要記錄所需要的量。如果我要馬上建立一個SQL表,我想最終:

Recipe: Ingredient: Recipe_Ingredient: 
id  id   recipe_id 
name  name   ingredient_id 
instr unit   amount 

正是我怎樣才能把這個Recipe_Ingredient關係到CD模式?我只需要添加包含這些屬性的RecipeIngredients實體嗎?

回答