|
||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
DataValue | A data value is an instance with no identity. |
Extent | Each instance of Extent owns a collection of instances and is used to link such collections to their structural and behavioral definitions in CWM Resource packages. |
FeatureSlot | The FeatureSlot association connects Slot instances with the StructuralFeature instance (usually either an Attribute or AssociationEnd instance) describing the structure of the value held by the Slot. |
Instance | The instance construct defines an entity to which a set of operations can be applied and which has a state that stores the effects of the operations. |
InstanceClassifier | The InstanceClassifier association links Instances with Classifiers that describe them. |
Object | An object is an instance that originates from a class. |
ObjectSlot | The ObjectSlot association connects Slot instances with their owning Object instances. |
Slot | A slot is a named location in an Object instance that holds the current value of the StructuralFeature associated with the Slot instance. |
SlotValue | The SlotValue association connects slot instances with the DataValue or Object instance that contains the current value held by the slot. |
The ObjectModel's Instance metamodel allows the inclusion of data instances with the metadata, since in addition to the metadata normally interchanged with CWM, it is sometimes useful to interchange specific data instances as well.
The Instance metamodel depends on the following package:
The Instance metamodel is shown in Figure 7-6-1:
To aid understanding of the appropriate use of Instance metamodel classes and associations, a full example is presented in Figure 7-6-3, below, showing how Instance metamodel objects are used to represent the model, shown in Figure 7-6-2, and its instances:
Figure 7-6-2 Example model
The example model describes people and their marital relationships to other people. Marital relationships are represented by the reflective Marriage association between two separate people. The Marriage association has two association ends named "person" and "spouse". Notice that each instance of the Marriage association has a string-valued attribute describing the current status of the marital relationship it represents. Valid values for the MaritalStatus attribute are "Married", "Divorced", and "Widowed". People who have never been married have no instances of the Marriage association.
Figure 7-6-3 (below) shows how the example model is represented as instances of the CWM ObjectModel metaclasses Class, Attribute, DataType, Association, and AssociationEnd. In addition, Instance metamodel classes are used to capture two kinds of data values that might be exchange using the CWM DTDs: valid values of the MaritalStatus attribute, and the marital relationship between the people George and Martha Custis Washington. In the figure, instances of the Instance metamodel are shown with a shaded background and labelled with an uppercase letter near their upper right corner to facilitate discussion. Lines in the figure represent ObjectModel associations that capture relationships between instances and are labelled with the association's name.
George is represented by Object A, and Martha, by Object B. These person objects own Slots C and D, respectively. Slot C holds DataValue E whose value attribute records George's name. Similarly, Slot D holds Martha's name in DataValue F.
The valid values of the MaritalStatus attribute are recorded by DataValue instances K, L, and M.
The marital relationship between George and Martha is represented, from George's perspective, by Object H which is an instance of the Marriage association. Object H owns Slots G, J, and I. Slot G holds the person association end and references Object A (George), whereas Slot I holds the spouse association end, referencing Object B (Martha). Slot J holds a DataValue instance describing the current value ("Married") of the MaritalStatus attribute for Object H.
For additional information, see the CWM specification at http://www.cwmforum.org.
|
||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |