Previous Table of Contents Next


7.2.1 Instances


   Instances of records are created by extending the ObjectModel’s Instance package as shown in Figure 7-3.


   FieldValue Record RecordSet

   Figure 7-3 Record metamodel instances

    Figure 7-4 shows an example of how record instances are created using the Record, FieldValue, and RecordSet classes. The example uses the metamodel instances in Figure 7-2 on page 7-3 to store the address of the President of the United States.

    : RecordFile ElementOwnership Customer :RecordDef

   InstanceClassifier

    : RecordSetElementOwnership :


Record

   ObjectSlot account :

    : SlotSlotValue : value ="123475" : FieldValueString


   FeatureSlot

   Field

    : SlotSlotValue

   FeatureSlot

   custName : Field

    : Slot : Object

   address1 : ObjectSlot : Slot SlotValue : value = "The White Field FeatureSlot

   ClassifierFeature Field FeatureSlot : SlotSlotValue : value ="Washington" :



InstanceClassifier

   address :Group

   FieldValueHouse" : String

   address2 : : SlotSlotValue : value = "1600 Pennsylvania

   Field FeatureSlot FieldValueAvenue NW" : String

   city :

   FieldValueString

   state : : SlotSlotValue : value = "DC" :

   Field FeatureSlot FieldValueString

   postcode : : SlotSlotValue : value = "20500" :

   Field FeatureSlot FieldValueString

   country : : SlotSlotValue : value = "USA" : FeatureSlot

   FieldValue String Field

   Figure 7-4 Record instance example