Re: Implementing product attributes

From: Raimundo Lozano <rlozano_at_medicina.ub.es>
Date: 2000/03/22
Message-ID: <38D88D42.D8A06D92_at_medicina.ub.es>#1/1


Joe \"Nuke Me Xemu\" Foster wrote:

> I was considering how one would model the situation where you have multiple
> types of beverages and books or expanded the business to handle many other
> objects besides beverages and books. In one, you'd have a whole mess of
> tables, including perhaps sub-sub tables and sub-sub-sub tables, so adding
> a new object might involve inserting into three or four tables. In the
> other, you'd end up with a lot of fields, most of which are unused in any
> particular row, and a very complex validation rule. However, I've seen the
> sub-table approach used in object-oriented languages, with each subtype
> responsible for maintaining its own subtable. Thomas Muller's approach
> looks interesting, though.

The problem with Thomas Muller's approach is the type of an attibute in order to check the value, perform queries (value > ...), etc. If you use an unique varchar field to store the value, you need to indicate the type of the attribute in another one. The alternative can be to have a field for every type you expect, like value_char, value_int, etc. With both you need complex validation rules.

Any suggest to solve that?

Raimundo Lozano Received on Wed Mar 22 2000 - 00:00:00 CET

Original text of this message