[Data-modeling] Products with ingredients
Kurt Bollacker
kurt at spaceship.com
Tue Jun 16 22:47:02 UTC 2009
On Tue, Jun 16, 2009 at 03:29:44PM -0700, Robert Cook wrote:
> > The other one is ingredients within ingredients: the toothpaste tube
> > lists this ingredient: "fruit extracts (strawberry, banana, and
> > other natural flavors)". Treat as four separate ingredients, and
> > punt on the relationship? I'm tempted toward this one -- if you're
> > looking for potential allergens, or animal-based ingredients, or the
> > like, you don't care whether the offending item is in a main
> > ingredient or is an ingredient of an ingredient.
>
> This is probably a good guideline - if there are sub-ingredients, they
> should probably be broken out when the data is added. The only
> problem here is that ordering matters -- on the original contents
> list, there is more of item N than item N+1 in the product. If you
> break them out, it's unclear where they should end up in the list.
This is exactly the same problem that Kirrily has to solve with her
Recipe schema. It seems like the ingredient type should work for both
products and recipies. It also seems like recipies have the same
containment tree pattern. A cherry pie has a "double butter crust" as
an ingredient, but this is a recipe as well. So products should be
able to contain other products as ingredients. For example, there is
a Ritter chocolate bar that contains corn flakes as an ingedient.
Kurt :-)
More information about the Data-modeling
mailing list