Re: Units of Measurement in the Database Model
Date: 30 May 2002 13:39:45 -0700
Message-ID: <a6e74506.0205301239.68fb0b3d_at_posting.google.com>
> From original poster:
> How should the database be organized in regards to measurements recorded,
> and the units of measurement (UOM) used to record them?
I am not suggesting to use an oodb solution but it may shed light on the appropriate rdb solution.
In XDb each "value" is actually an object. Each "value" (ie 130, 180) is an instance of a class (ie Weight) or its descendant sub classes. The base class can define a default UOM as a static property. A static (as opposed to a virtual) property does not propagate with instances of Weight. Any sub class or instance can override the default by having a UOM property.
Implementation would be:
Classes
UOM Weight
.UOM - lb // Static property of weight
Instances
UomInstsFldr
lb
kg
WeightInstsFldr
130 // Inherits UOM = lb as defined in class
180
.UOM - kg // Overrides default UOM defined in Class
Thus,
130.Prop_get(UOM) returns 'lb'. 130 inherits the default UOM defined
in its class.
180.Prop_get(UOM) returns 'kg'. 180's UOM overrides that defined in
its class.
It is also possible to define as such
Classes
System
UOM
.System = Unknown
Instances
System
Unknown
English
Metric
UomFldr
lb
.System = English
kg
.System = Metric
Thus,
(130.Prop_get(UOM)).Prop_get(System) returns 'English'
(180.Prop_get(UOM)).Prop_get(System) returns 'Metric'
Above implementation is described more visually at www.xdb1.com/Basics/UOM.asp
Also see www.xdb1.com/Dev/API/Obj/Prop_get.asp & ww.xdb1.com/Basics/Property.asp Received on Thu May 30 2002 - 22:39:45 CEST