| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Units of Measurement in the Database Model
> 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
Instances
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
UOM
.System = Unknown
Instances
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 - 15:39:45 CDT
![]() |
![]() |