Re: How to represent category, subcategory, product

From: Neo <>
Date: 23 Nov 2006 07:55:19 -0800
Message-ID: <>

> The classic scenario calls for a root class with all the common
> attributes and then specialized sub-classes under it.  As an example,
> let's take the class of Vehicles and find an industry standard
> identifier (VIN), and add two mutually exclusive sub-classes, Sport
> utility vehicles and sedans ('SUV', 'SED').

Below is an alternative solution using dbd where a vehicle can have 0 to many classifications. Disadv: subClasses need to be derived. Adv: flexibility to classify things as desired.

(new 'vin)

(new 'vehicle0)
(set vehicle0 vin (val+ '_at_1234))

(new 'vehicle1 'car '1-door)
(set vehicle1 vin (val+ '45?67))

(new 'vehicle2 'car 'suv)
(set vehicle2 vin (val+ 'JFH#3638))

(new 'vehicle3 'car 'sedan '5-door)
(set vehicle3 vin (val+ '8-9-A0))

(new 'vehicle4 'car 'suv 'sedan)
(set vehicle4 vin (val+ '3G$67))

(new 'vehicle5 'car 'boat 'suv 'sedan)
(set vehicle5 vin (val+ 'NH&74H6))

(new 'vehicle6 'boat 'airplane 'suv 'sedan 'rv '9-door)
(set vehicle6 vin (val+ 'N5*J4H6))

(new 'vehicle7 'car 'economy 'beetle 'bug)
(set vehicle7 vin (val+ 'VW=578))

(; Find suvs)
(; Returns vehicle2, vehicle4, vehicle5, vehicle6)
(get suv instance *)
Received on Thu Nov 23 2006 - 16:55:19 CET

Original text of this message