Reputation: 43
Even though I understand what a weak entity is and the definition of total participation I find it hard to distinguish what to use in practice.
In this example I can't understand why the restaurant is not a weak entity. A restaurant can't exist without dishes. The same goes for dish-ingredients--a dish with 0 ingredients cannot exist.
So, why are restaurant-dish and dish-ingredient only represented with a total participation and not as weak entities too?
Upvotes: 3
Views: 5522
Reputation: 17147
Restaurant is not a weak entity because it can exist on its own. The same rule applies to Ingredients. Ingredients don't need do be put within any dish, but a dish can't exist without any ingredients. Dish cannot exist if there is no corresponding restaurant serving that particular dish. Consider a menu with dishes that doesn't belong to any restaurant. What would be the purpose of it in your model?
Are you sure you understand the purpose of weak entity and not think of it the other way around as it currently stands?
Upvotes: 2