Previous Table of Contents Next


4.6.1 Instance Classes


4.6.1.1 DataSlot

   A Slot that is used to hold a data value where there is no need to manage the value as an element in its own right (in which case a DataValue would be used) - for example it is a one-off string value or a number. The dataValue (and dataType where set) must be consistent with the type of the DataSlot’s feature (Attribute) and must obey any constraints on the full descriptor of the Attribute’s DataType (including both explicit constraints and built-in constraints such as multiplicity).

   Superclasses

   Slot

   Attributes

   dataValue

The value for the slot expressed as a string.

type:

multiplicity:

String
exactly one

   References

   dataType

The type of the dataValue. If not set, the type is taken as the type of the Attribute (StructuralFeature) that is the feature for the DataSlot.

class:

defined by:

multiplicity:

DataType
DataSlotType::dataType
zero or one

   Constraints

   A DataType instance associated with a DataSlot instance must be compatible with the type of the DataSlot indicated by the feature::type inherited from Slot. [C-6-6]

   The StructuralFeature instance obtained via the feature reference inherited from Slot must be an Attribute. [C-6-7]

   The value reference inherited from Slot must be empty. [C-6-8]

4.6.1.2 DataValue

   A data value is an instance with no identity. In the metamodel, DataValue is a child of Instance that cannot change its state; that is, all operations that are applicable to it are pure functions or queries that do not cause any side effects. DataValues are typically used as attribute values.

   Since it is not possible to differentiate between two data values that appear to be the same, it becomes more of a philosophical issue whether there are several data values representing the same value or just one for each value. In addition, a data value cannot change its data type and it does not have contained instances.

   Superclasses

   Instance

   Attributes

   value

A string representation of the value.

type:

multiplicity:

String
exactly one

   Constraints

   A DataValue originates from a Classifier that is a DataType. [C-6-1]

   A DataValue has no Slots. [C-6-2]

4.6.1.3 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. Because Extent is a subclass of package, it owns member instances via the ElementOwnership association.

   Superclasses

   Package

   Contained Elements

   Object

4.6.1.4 Instance Abstract

   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. In the metamodel Instance is connected to a Classifier that declares its structure and behavior. It has a set of attribute values matching the definition of its Classifier. The set of attribute values implements the current state of the Instance.

   Because Instance is an abstract class, all Instances are either Object or DataValue instances.

   The data content of an Instance comprises one value for each attribute in its full descriptor (and nothing more). The value must be consistent with the type of the attribute. An instance must obey any constraints on the full descriptor of the Classifier of which it is an instance (including both explicit constraints and built-in constraints such as multiplicity).

   Superclasses

   ModelElement

   References

   classifier

The Classifier that declares the structure of the Instance.

class:

defined by:

multiplicity:

Classifier
InstanceClassifier::classifier
exactly one

4.6.1.5 Object

   An object is an instance that originates from a class.

   In the metamodel Object is a subclass of Instance originating from a Class. The Class may be modified dynamically, which means that the set of features of the Object may change during its lifetime.

   An object is an instance that originates from a class; it is structured and behaves according to its class. All objects originating from the same class are structured in the same way, although each of them has its own set of attribute slots. Each attribute slot references an instance, usually a data value or possibly another object. The number of attribute slots with the same name fulfills the multiplicity of the corresponding attribute in the class. The set may be modified according to the specification in the corresponding attribute. For example, each referenced instance must originate from (a specialization of) the type of the attribute, and attribute slots may be added or removed according to the changeable property of the attribute.

   An Object instance’s slots may contain either DataValue instances or other Object instances. Owned Object instances occur as side-effects of either of two metamodel situations: First, the Classifier of the owning instance contains features (via the ClassifierFeature association) whose types are non-DataType Classifiers. Second, the StructuralFeature describing the attribute slot is an AssociationEnd.

   An Object instance may own other Object instances. This occurs when the Classifier describing the owning Object contains the Classifier(s) describing the owned object through namespace containment via the ElementOwnership association. Namespace rules imply that an Object instance contained in another Object instance has access to all names that are accessible to its container instance.

   Superclasses

   Instance

   Contained Elements

   Slot

   References

   slot

The set of Slot instances owned by the Object.

class:

defined by:

multiplicity:

inverse:

Slot
ObjectSlot::slot
zero or more
Slot::object

   Constraints

   An Object may only own Objects and DataValues. [C-6-3]

   If an Object represents an association, at least two of its ends must not be empty. [C-6-4]

4.6.1.6 Slot

   A slot is a named location in an Object instance that holds the current value of the StructuralFeature associated with the Slot instance. Normally, the StructuralFeature associated with the slot will be either an Attribute instance or an AssociationEnd instance. Slots are owned by Objects; DataValues do not have slots.

   Superclasses

   ModelElement

   References

   feature

References the StructuralFeature instance that describes the value held by the Slot instance.

class:

defined by:

multiplicity:

StructuralFeature
FeatureSlot::feature
exactly one

   object

References the Object instance that owns the Slot.

class:

defined by:

multiplicity:

inverse:

Object
ObjectSlot::object
zero or one
Object::slot

   value

References the DataValue or Object instance that contains the current value held by the Slot.

class:

defined by:

multiplicity:

Instance
SlotValue::value
zero or one

   Constraints

   If the StructuralFeature describing a Slot is an AssociationEnd, the Classifier associated with the Object owning the Slot must be an Association. [C-6-5]

   If the Slot instance is not also a DataSlot, the value reference must be present. [C-6-9]