|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I've to create a commercial website wich will have a central table to manage all articles. Each article must be on a certain type and will have its own specification. So when entering values for a certain type then I've to show the specific fields controls to entere the values or search them. example: I sell musical instruments. - guitars - pianos - trumpets ..... Guitars has some specific features that are different from pianos and also differents from trumpets. So when I add a new guitar I've to show the specific features. When I add a new piano the feature to select are different. The problem is that I don't know how to manage such specific features dynamically. I mean I may create a table for guitars, a table for pianos....but this won't be very interesting since there is about 300 different kind of instruments in the shop and creating 300 tables for this won't be very interesting. I've no idea on where to start and how to do so. The idea of having an unique table for articles is for searching and managing purpose as searching on 300 items table..... So it should greately simplify the website and also it will be able to manage any kind of object, whatever the number of different kind would be present on the shop. Also searching guitars will be different from searching pianos and so on....and only 1 search engine should be provided to search all kind of objects with the specific fields. So for what I may guess there will be a table for articles and a table with article kind specifications but I don't know if it will be enough and how to create them. Thanks for ing. Bob |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
"Bob Bedford" <bob@bedford.com> wrote in message news:4701e92c$0$3807$5402220f@news.sunrise.ch... > Hi, > > I've to create a commercial website wich will have a central table to manage > all articles. Each article must be on a certain type and will have its own > specification. So when entering values for a certain type then I've to show > the specific fields controls to entere the values or search them. > > example: > I sell musical instruments. > - guitars > - pianos > - trumpets > .... > Guitars has some specific features that are different from pianos and also > differents from trumpets. > So when I add a new guitar I've to show the specific features. When I add a > new piano the feature to select are different. > The problem is that I don't know how to manage such specific features > dynamically. I mean I may create a table for guitars, a table for > pianos....but this won't be very interesting since there is about 300 > different kind of instruments in the shop and creating 300 tables for this > won't be very interesting. I've no idea on where to start and how to do so. > The idea of having an unique table for articles is for searching and > managing purpose as searching on 300 items table..... So it should greately > simplify the website and also it will be able to manage any kind of object, > whatever the number of different kind would be present on the shop. Also > searching guitars will be different from searching pianos and so on....and > only 1 search engine should be provided to search all kind of objects with > the specific fields. > So for what I may guess there will be a table for articles and a table with > article kind specifications but I don't know if it will be enough and how to > create them. > > Thanks for ing. > > Bob > Hi Bob, You are dealing with a classic Supertype/Subtype relationship. It models reality fairly well. The Supertype table contains columns that are common to all articles such as price, category, and date created. The Subtype table has columns that are specific to a particular Category. What is great about this model is that is very easy to add a new Subtype. Also, Subtypes will have few if any nulls, which is always a positive. Sometimes an approach that models the real world is better than an approach that is "more interesting". Let the front end determine the search criteria. Evan |
|
![]() |
| Outils de la discussion | |
|
|