Re: how to do a product->product-type->product-attributes with non pre-determined product-attributes?
Re: how to do a product->product-type->product-attributes with non pre-determined product-attributes?
- Subject: Re: how to do a product->product-type->product-attributes with non pre-determined product-attributes?
- From: Florijan Stamenkovic <email@hidden>
- Date: Mon, 14 May 2007 15:26:41 +0200
Hi Johan,
I am currently doing something similar. However, due to the amounts
database rows that your kind of a solution would warrant in our
situation, I have thought of a different approach.
I will use your terminology (table names etc) to try to explain.
It comes down to defining a ProductType table that contains an
Attrributes field of type char, varchar, text or whatever you prefer.
That field then contains the information of what Attributes are there
for a specific ProductType in a defined, parseable format. For
example it could say:
"PriceInEuros(Double),PriceInDollars(Double),NumberOfDoors
(Integer),Airco(Boolean)"
So, you have a definition of attributes and their types (String,
Integer...) for every ProductType record. Thereafter you can define a
Product table that contains a Values field, which is also char, or
text or whatever. That field contains the values for the attributes
that are defined in the ProductType record that the Product record is
related to. To follow the example above, it could be something like:
"123.45,150.00,5,true"
See my point? What I see as the benefits of this approach is that you
can accomplish what you described in 4 tables (+join tables for many-
to-many) in just 2 tables. Which is good. The downside of it is that
you gotta make a runtime that would parse your "Attribute" and
"Value" data for relevant ProductTypes and Products.
In our situation it was a better solution. If you are interested and
want to discuss this some more, please contact me off-list.
F
Is there anybody that has done that kind of thing, or does anybody
know any examples that do the same thing?
Regards,
Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6273852
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden