Package org.omg.cwm.objectmodel.instance

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.

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.
 

Package org.omg.cwm.objectmodel.instance Description

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:

Instance metamodel Extent Object DataValue Slot Instance Package (from Core) StructuralFeature (from Core) Classifier (from Core) ModelElement (from Core)

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

Instance metamodel 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.

Instance metamodel example instances DataValue DataValue DataValue DataValue DataValue Object Slot Slot Slot Slot Slot Object Object

For Additional Information

For additional information, see the CWM specification at http://www.cwmforum.org.

Since:
1.0


Copyright 1997-2005 by Object Management Group, Inc. (http://www.omg.org/), 250 First Ave. Needham, MA 02494 U.S.A. All rights reserved. Unless otherwise indicated, users may make a single copy of the contents, in whole or in part, of this web site strictly for personal, non-commercial use. In the event that all or part of this site is downloaded for personal use, users shall maintain all proprietary notices including copyright notices that appear on or in connection with that content. Other than creating a single copy of contents for personal use as described herein, users may not copy, reproduce, distribute, republish, download, display, post or transmit in any form or by any means, including but not limited to electronic, mechanical, photocopying, recording, or other means, any content found or linked to the OMG web site without the prior express written permission of OMG. Any unauthorized use of any content contained on the OMG web site may violate the copyright laws, trademark laws, laws relating to publicity and privacy, and other regulations and statutes in the U.S. and other countries.