Previous Table of Contents Next


7.4 MOF Model Classes

7.4.1 ModelElement (abstract)

   ModelElement classifies the elementary atomic constructs of models. ModelElement is the root Class within the MOF Model.

   SuperClasses

   None. (While the CORBA IDL for ModelElement inherits from Reflective::RefObject, this is not generalization in the MOF Model sense. Rather it is an artifact of the IDL mapping.)

   Attributes name

Provides a meta-modeler supplied name that uniquely identifies the ModelElement in the context of the ModelElement’s containing Namespace. When choosing a ModelElement’s name, the meta-modeler should consider the rules for translating names into identifiers in the relevant mappings (e.g., 9.7.1, “Generated IDL Identifiers,? on page 198). To minimize portability problems, use names that start with an ASCII letter, and consist of ASCII letters and digits, space and underscore. Avoid names where capitalization, spaces, or underscores are significant.

type:

multiplicity:

String
exactly one

   qualifiedName

Provides a unique name for the ModelElement within the context of its outermost containing Package. The qualifiedName is a list of String values consisting of the names of the ModelElement, its container, its container’s container, and so on until a non-contained element is reached. The first member of the list is the name of the non-contained element.

type:

multiplicity:

changeable:

derived from:

String
one or more; ordered
no
[S-12] on page 130

   annotation

Provides an informal description of the ModelElement.

type:

multiplicity:

String
exactly one

   References container

Identifies the Namespace that contains the ModelElement. Since the Contains Association is a Composite Association, any ModelElement can have at most one container, and the containment graph is strictly tree shaped.

type:

defined by:

multiplicity:

inverse:

Namespace
Contains::container
zero or one
ModelElement::contents

   requiredElements

Identifies the ModelElements on whose definition the definition of this ModelElement depends. For a definition of dependency, see 7.5.9, “DependsOn (derived),? on page 93.

type:

defined by:

multiplicity:

ModelElement
DependsOn::provider
zero or more

   constraints

Identifies the set of Constraints that apply to the ModelElement. A Constraint applies to all instances of the ModelElement and its sub-Classes.

type:

multiplicity:

inverse:

defined by:

Constraint
zero or more
Constraint::constrainedElements.
Constrains::provider

   Operations findRequiredElements

   This operation selects a subset of the ModelElements that this one depends on, based on their dependency categories. The “kinds? argument gives the kinds of dependency of interest to the caller.

    String constants for the standard dependency categories are given in 7.8, “MOF Model Constants,? on page 99 and their meanings are defined in 7.5.9, “DependsOn (derived),? on page 93. In this context, the AllDep pseudo-category (i.e., “all?) is equivalent to passing all of the standard categories, and the IndirectDep pseudo-category (i.e., “indirect?) is ignored.

    ... continued

   findRequiredElements

If the “recursive? argument is “false,? the operation returns the direct dependents only. If it is “true,? all dependents in the transitive closure of DependsOn for the specified “kinds? are returned.

return type:

isQuery:

parameters:

operation semantics

ModelElement (multiplicity: zero or more; unordered, unique)
yes
kinds: in String (multiplicity: one or more; unordered; unique) recursive: in Boolean
[S-4] on page 125

   isRequiredBecause

This operation performs two functions: • It checks whether this ModelElement directly or indirectly depends on the ModelElement given by “otherElement.? If it does, the operation’s result is “true;? otherwise, it is “false.? • If a dependency exists; that is, the result is “true,? the operation returns a String in “reason? that categorizes the dependency. String constants for the dependency kind categories are given in 7.8, “MOF Model Constants,? on page 99 and their meanings are defined in 7.5.9, “DependsOn (derived),? on page 93. If the dependency is indirect, IndirectDep is returned. If there are multiple dependencies, any category that applies may be returned in “reason.? If no dependencies exist, an empty string is returned in “reason.?

return type:

isQuery:

parameters:

operation semantics

Boolean
yes
otherElement: in ModelElement reason: out String
[S-5] on page 126

   isFrozen

Reports the freeze status of a ModelElement. A ModelElement, at any particular time, is either frozen or not frozen. All ModelElements of a published model are permanently frozen.

return type:

isQuery:

Boolean
yes

   isVisible

Returns true. This operation is reserved for future use when the MOF visibility rules have stabilized. Then it will determine whether the supplied otherElement is visible to this ModelElement.

return type:

isQuery:

parameters:

operation semantics

Boolean
yes
otherElement: in ModelElement
[S-3] on page 125

   Constraints

   A ModelElement that is not a Package must have a container. [C-1]

    The attribute values of a ModelElement that is frozen cannot be changed. [C-2] on page 105.

    A frozen ModelElement that is in a frozen Namespace can only be deleted, by deleting the Namespace. [C-3] on page

    106 .

    The link sets that express dependencies of a frozen Element on other Elements cannot be explicitly changed. [C-4] on page 106 .

   IDL

   interface ModelElementClass : Reflective::RefObject {

   readonly attribute ModelElementSet all_of_type_model_element;

   const string MUST_BE_CONTAINED_UNLESS_PACKAGE =

   "org.omg.mof:constraint.model.model_element.must_be_contained_unless_package";

   const string FROZEN_ATTRIBUTES_CANNOT_BE_CHANGED =

   "org.omg.mof:constraint.model.model_element.frozen_attributes_cannot_be_changed";

   const string FROZEN_ELEMENTS_CANNOT_BE_DELETED =

   "org.omg.mof:constraint.model.model_element.frozen_elements_cannot_be_deleted";

   const string FROZEN_DEPENDENCIES_CANNOT_BE_CHANGED =

   "org.omg.mof:constraint.model.model_element.frozen_dependencies_cannot_be_changed";

   const DependencyKind CONTAINER_DEP = "container";

   const DependencyKind CONTENTS_DEP = "contents";

   const DependencyKind SIGNATURE_DEP = "signature";

   const DependencyKind CONSTRAINT_DEP = "constraint";

   const DependencyKind CONSTRAINED_ELEMENTS_DEP = "constrained elements";

   const DependencyKind SPECIALIZATION_DEP = "specialization";

   const DependencyKind IMPORT_DEP = "import";

   const DependencyKind TYPE_DEFINITION_DEP = "type definition";

   const DependencyKind REFERENCED_ENDS_DEP = "referenced ends";

   const DependencyKind TAGGED_ELEMENTS_DEP = "tagged elements";

   const DependencyKind INDIRECT_DEP = "indirect";

   const DependencyKind ALL_DEP = "all"; }; // end of interface ModelElementClass

   interface ModelElement : ModelElementClass { wstring name () raises (Reflective::MofError); void set_name (in wstring new_value) raises (Reflective::MofError); ::PrimitiveTypes::WStringList qualified_name () raises (Reflective::MofError); wstring annotation () raises (Reflective::MofError); void set_annotation (in wstring new_value) raises (Reflective::MofError); ModelElementSet required_elements () raises (Reflective::MofError); ModelElementSet find_required_elements (in ::PrimitiveTypes::WStringSet kinds, in boolean recursive) raises (Reflective::MofError); boolean is_required_because (in ModelElement other_element, out wstring reason) raises (Reflective::MofError); Namespace container ()

   raises (Reflective::NotSet, Reflective::MofError); void set_container (in Namespace new_value)raises (Reflective::MofError);void unset_container ()raises (Reflective::MofError);ConstraintSet constraints ()raises (Reflective::MofError);void set_constraints (in ConstraintSet new_value)raises (Reflective::MofError);void add_constraints (in Constraint new_element)raises (Reflective::MofError);void modify_constraints (in Constraint old_element, in Constraint new_element)raises (Reflective::MofError);void remove_constraints (in Constraint old_element)raises (Reflective::NotFound, Reflective::MofError);boolean is_frozen ()raises (Reflective::MofError);boolean is_visible (in ModelElement other_element)raises (Reflective::MofError); };

7.4.2 Namespace (abstract)

   The Namespace Class classifies and characterizes ModelElements that can contain other ModelElements. Along with containing the ModelElements, a Namespace defines a namespace, the allowable set of names, and the naming constraints for these elements.

   Subclasses of the Namespace Class have mechanisms for effectively extending their namespace, without actually containing additional ModelElements. Thus Namespace can be viewed in terms of its two roles, as a container and as a namespace mechanism. Because only subclasses extend the namespace, the namespace and contents are coincident in the definition of the Namespace Class. Each Namespace has four collections (the latter three derivable) that are used in the MOF Model’s Constraints. These collections are:

    The definitions of these collections may be found in 7.9.6, “OCL Helper functions,? on page 131.

   SuperClasses

   ModelElement

   References

   contents

Identifies the set of ModelElements that a Namespace contains.

class:

defined by:

multiplicity:

inverse:

ModelElement
Contains::containedElement
zero or more; ordered
ModelElement::container

   Operations lookupElement

Searches for an element contained by this Namespace whose name is precisely equal (as a wide string) to the supplied name. The operation either returns a ModelElement that satisfies the above, or raises the NameNotFound exception.

return type:

isQuery:

parameters:

exceptions:

operation semantics:

ModelElement
yes
name : in String
NameNotFound
[S-6] on page 127

   resolveQualifiedName

Searches for a ModelElement contained within this Namespace that is identified by the supplied qualifiedName. The qualifiedName is interpreted as a “path? starting from this Namespace.

return type:

isQuery:

parameters:

exceptions:

operation semantics:

ModelElement (exactly one). If no element is found, an exception is raised.
yes
qualifiedName : in String (multiplicity one or more; ordered; not unique)
NameNotResolved
[S-7] on page 128

   findElementsByType

Returns a list of the ModelElements contained by this Namespace that match the Class supplied. If ‘includeSubtypes’ is false, this operation returns only those elements whose most-derived Class is ‘ofType.’ If ‘includeSubtypes’ is true, the operation also returns instances of subtypes of ‘ofType.’ The order of the elements in the returned list is the same as their order in the Namespace. For example, “findElementsByType(ModelElement, false)? always returns an empty list, since ModelElement is an abstract Class. On the other hand, “findElementsByType(ModelElement, true)? always returns the contents of the Namespace, since all their Classes are subtypes of ModelElement.

return type:

isQuery:

parameters:

operation semantics:

ModelElement (multiplicity zero or more; ordered; unique)
yes
ofType : in Class includeSubtypes : in Boolean
[S-9] on page 129.

   nameIsValid

Determines whether the proposedName can be used as the name for a new member ModelElement in this Namespace. Specifically, it checks that the Namespace uniqueness rules would still be satisfied after adding such a name.

return type:

isQuery:

parameters:

operation semantics:

Boolean
yes
proposedName : in String
[S-8] on page 128.

   Constraints

    The names of the contents of a Namespace must not collide. [C-5] on page 107.

   IDL

   interface NamespaceClass : ModelElementClass { readonly attribute NamespaceSet all_of_type_namespace; const string CONTENT_NAMES_MUST_NOT_COLLIDE =

    "org.omg.mof:constraint.model.namespace.content_names_must_not_collide"; exception NameNotFound {

    wstring name; }; exception NameNotResolved {

    wstring explanation; ::PrimitiveTypes::WStringList rest_of_name; }; }; // end of interface NamespaceClass

    interface Namespace : NamespaceClass, ModelElement {ModelElementUList contents ()raises (Reflective::MofError);

   void set_contents (in ModelElementUList new_value) raises (Reflective::MofError);void add_contents (in ModelElement new_element) raises (Reflective::MofError);

    void add_contents_before (in ModelElement new_element, in ModelElement before_element) raises (Reflective::NotFound, Reflective::MofError);void modify_contents (in ModelElement old_element, in ModelElement new_element) raises (Reflective::NotFound, Reflective::MofError);

    void remove_contents (in ModelElement old_element) raises (Reflective::NotFound, Reflective::MofError);

    ModelElement lookup_element (in wstring name) raises (NamespaceClass::NameNotFound, Reflective::MofError); ModelElement resolve_qualified_name (in ::PrimitiveTypes::WStringList qualified_name) raises (NamespaceClass::NameNotResolved, Reflective::MofError); ModelElementUList find_elements_by_type (in Class of_type, in boolean include_subtypes) raises (Reflective::MofError); boolean name_is_valid (in wstring proposed_name) raises (Reflective::MofError); };

7.4.3 GeneralizableElement (abstract)

   The GeneralizableElement Class classifies and characterizes ModelElements that can be generalized through supertyping and specialized through subtyping. A GeneralizableElement inherits the features of each of its supertypes, the features of the supertypes of the immediate supertypes, and so on. In other words, all the features of the transitive closure of all the supertypes of the GeneralizableElement.

   When a GeneralizableElement inherits a feature, that feature name effectively becomes part of the namespace for the GeneralizableElement and the feature is considered part of the extended namespace of the Namespace. Therefore, a GeneralizableElement cannot have a superclass if it causes an inherited feature to have a namespace collision with its own features - see Constraint [C-8] on page 108 .

   To the degree that a GeneralizableElement is defined by its features, the superclass / subclass association defines substitutability. Any instance of a GeneralizableElement can be supplied wherever an instance of a superclass of that GeneralizableElement is expected.

   SuperClasses

   Namespace

   Attributes

   isRoot isLeaf

Specifies whether the GeneralizableElement may have supertypes. True indicates that it may not have supertypes, false indicates that it may have supertypes (whether or not it actually has any).

type:

multiplicity:

Boolean
exactly one

Specifies whether the GeneralizableElement may be a supertype of another Generalizable Element. True indicates that it may not be a supertype, false indicates that it may be a supertype (whether or not it actually is).

type:

multiplicity:

Boolean
exactly one

   isAbstract

Indicates whether the GeneralizableElement is expected to have instances. When isAbstract is true, any instance that is represented or classified by this GeneralizableElement is additionally an instance of some specialization of this GeneralizableElement. No operation that supports creation of instances of this GeneralizableElement should be available.

type:

multiplicity:

Boolean
exactly one

   visibility

In the future, this Attribute will be used to limit the ability of ModelElements outside of this GeneralizableElement’s container to depend on it; see 7.6.3, “VisibilityKind,? on page 97. The rules of visibility of MOF ModelElements are not currently specified.

type:

multiplicity:

VisibilityKind
exactly one

   References supertypes

Identifies the set of superclasses for a GeneralizableElement. Note that a GeneralizableElement does not have a reference to its subclasses.

class:

defined by:

multiplicity:

GeneralizableElement
Generalizes::supertype
zero or more; ordered

   Operations

   allSupertypes

Returns a list of direct and indirect supertypes of this GeneralizableElement. A direct supertype is a GeneralizableElement that directly generalizes this one. An indirect supertype is defined (recursively) as a supertype of some other direct or indirect supertype of the GeneralizableElement. The order of the list elements is determined by a depth-first traversal of the supertypes with duplicate elements removed.

return type:

isQuery:

parameters:

operation semantics:

GeneralizableElement (multiplicity zero or more, ordered, unique)
yes
none
[S-1] on page 125.

   lookupElementExtended

Returns an element whose name matches the supplied “name.? Like the “lookupElement? operation on Namespace, this operation searches the contents of the GeneralizableElement. In addition, it tries to match the name in the contents of all direct and indirect supertypes of the GeneralizableElement. For Packages, a subclass of GeneralizableElement, the operation can also match a Namespace associated with an Import object. NameNotFound is raised if no element matches the name.

return type:

isQuery:

parameters:

exceptions

operation semantics:

ModelElement (multiplicity exactly one)
yes
name : in wstring
NameNotFound
[S-10] on page 129

   findElementsByTypeExtended

Provides an extension of the findElementsByType defined for Namespace so that contained elements of all superclasses (direct and indirect) of the GeneralizableElement are included in the search. The order of the returned elements is determined by the order of the elements contained in the GeneralizableElements and a depth-first traversal of the superclasses. Subclasses can include a larger overall area for the lookup. Package, a subclass of GeneralizableElement, also considers the elements brought into this Namespace through the use of Import.

return type:

isQuery:

parameters:

operation semantics:

ModelElement (multiplicity zero or more; ordered; unique)
yes
ofType : in Class includeSubtypes : in Boolean
[S-11] on page 130.

   Constraints

    A Generalizable Element cannot be its own direct or indirect supertype. [C-6] on page 107.

    A supertypes of a GeneralizableElement must be of the same kind as the GeneralizableElement itself. [C-7] on page 107.

   The names of the contents of a GeneralizableElement should not collide with the names of the contents of any direct or indirect supertype. [C-8] on page 108 .

   Multiple inheritance must obey the “Diamond Rule.? [C-9] on page 108 .

    If a Generalizable Element is marked as a “root,? it cannot have any supertypes. [C-10] on page 108.

    A GeneralizableElement’s immediate supertypes must all be visible to it. [C-11] on page 109.

    A GeneralizableElement cannot inherit from a GeneralizableElement defined as a “leaf.? [C-12] on page 109.

   IDL

   interface GeneralizableElementClass : NamespaceClass { readonly attribute GeneralizableElementUList all_of_type_generalizable_element; const string SUPERTYPE_MUST_NOT_BE_SELF =

    "org.omg.mof:constraint.model.generalizable_element.supertype_must_not_be_self"; const string SUPERTYPE_KIND_MUST_BE_SAME = "org.omg.mof:constraint.model.generalizable_element.supertype_kind_must_be_same";

    const string CONTENTS_MUST_NOT_COLLIDE_WITH_SUPERTYPES "org.omg.mof:constraint.model.generalizable_element? “.contents_must_not_collide_with_supertypes";

    const string DIAMOND_RULE_MUST_BE_OBEYED = "org.omg.mof:constraint.model.generalizable_element.diamond_rule_must_be_obeyed"; const string NO_SUPERTYPES_ALLOWED_FOR_ROOT = "org.omg.mof:constraint.model.generalizable_element.no_supertypes_allowed_for_root"; const string SUPERTYPES_MUST_BE_VISIBLE = "org.omg.mof:constraint.model.generalizable_element.supertypes_must_be_visible"; const string NO_SUBTYPES_ALLOWED_FOR_LEAF = "org.omg.mof:constraint.model.generalizable_element.no_subtypes_allowed_for_leaf";

   }; // end of interface GeneralizableElementClass

   interface GeneralizableElement : GeneralizableElementClass, Namespace { boolean is_root () raises (Reflective::MofError); void set_is_root (in boolean new_value) raises (Reflective::MofError); boolean is_leaf () raises (Reflective::MofError); void set_is_leaf (in boolean new_value) raises (Reflective::MofError); boolean is_abstract () raises (Reflective::MofError); void set_is_abstract (in boolean new_value) raises (Reflective::MofError); VisibilityKind visibility () raises (Reflective::MofError); void set_visibility (in VisibilityKind new_value)

    raises (Reflective::MofError); GeneralizableElementUList supertypes () raises (Reflective::MofError); void set_supertypes (in GeneralizableElementUList new_value) raises (Reflective::MofError); void add_supertypes (in GeneralizableElement new_element) raises (Reflective::MofError); void add_supertypes_before (in GeneralizableElement new_element, in GeneralizableElement before_element) raises (Reflective::NotFound, Reflective::MofError); void modify_supertypes (in GeneralizableElement old_element, in GeneralizableElement new_element) raises (Reflective::NotFound, Reflective::MofError); void remove_supertypes (in GeneralizableElement old_element) raises (Reflective::NotFound, Reflective::MofError); GeneralizableElementSet all_supertypes () raises (Reflective::MofError); ModelElement lookup_element_extended (in wstring name) raises (NameNotFound, Reflective::MofError); ModelElementUList find_elements_by_type_extended (in Class of_type, in boolean include_subtypes) raises (Reflective::MofError); };

7.4.4 TypedElement (abstract)

   The TypedElement type is an abstraction of ModelElements that require a type as part of their definition. A TypedElement does not itself define a type, but is associated with a Classifier. The relationship between TypedElements and Classifiers is shown in Figure 7.3 on page 53.

   SuperClasses

   ModelElement

   References

   type

Provides the representation of the type supporting the TypedElement through this reference.

class:

defined by:

multiplicity:

Classifier
IsOfType::type
exactly one

   Constraints

    An Association cannot be the type of a TypedElement. [C-13] on page 109. A TypedElement can only have a type that is visible to it. [C-14] on page 110.


   Figure 7.3 - MOF Model Classifiers

   IDL

   interface TypedElementClass : ModelElementClass { // get all typed_element including subtypes of typed_element readonly attribute TypedElementSet all_of_type_typed_element; const string ASSOCIATIONS_CANNOT_BE_TYPES =

    "org.omg.mof:constraint.model.typed_element.associations_cannot_be_types";const string TYPE_MUST_BE_VISIBLE = "org.omg.mof:constraint.model.typed_element.type_must_be_visible"; }; // end of interface TypedElementClass

    interface TypedElement : TypedElementClass, ModelElement { Classifier type ()raises (Reflective::MofError);void set_type (in Classifier new_value)raises (Reflective::MofError); };

7.4.5 Classifier (abstract)

   A classifier provides a classification of instances through a set of Features it contains.

   SuperClasses

   GeneralizableElement

   IDL

   interface ClassifierClass : GeneralizableElementClass {

    readonly attribute ClassifierSet all_of_type_classifier; }; // end of interface ClassifierClass

   interface Classifier : ClassifierClass, GeneralizableElement { };

7.4.6 Class

   A Class defines a classification over a set of object instances by defining the state and behavior they exhibit. This is represented through operations, attributes, references, participation in associations, constants, and constraints. Similar concepts are used in other environments for representing Classes and their implementations. However, in the MOF the class characteristics are modeled in an implementation-independent manner. For instance, an attribute of a Class is specified independently of any code to store and manage the attributes value. The implementation simply must insure that its behavior conforms to behavior specified by the chosen technology mapping. The MOF Class construct is more than just an interface specification.

   SuperClasses

   Classifier

   Contained Elements

    Class, DataType subtypes, Attribute, Reference, Operation, Exception, Constraint, Constant, Tag; see constraint [C-15] on page 110 .

   Attributes

   isSingleton

When isSingleton is true, at most one M1 level instance of this Class may exist within the M1-level extent of the Class.

type:

multiplicity:

Boolean
exactly one

   Constraints

   A Class may contain only Classes, DataTypes, Attributes, References, Operations, Exceptions, Constants, Constraints, and Tags. [C-15] on page 110.

    A Class that is marked as abstract cannot also be marked as singleton. [C-16] on page 110.

   IDL

   interface ClassClass : ClassifierClass { readonly attribute ClassSet all_of_type_class; readonly attribute ClassSet all_of_class_class; const string CLASS_CONTAINMENT_RULES =

    "org.omg.mof:constraint.model.class.class_containment_rules"; const string ABSTRACT_CLASSES_CANNOT_BE_SINGLETON = "org.omg.mof:constraint.model.class.abstract_classes_cannot_be_singleton";

   Class create_class (/* from ModelElement */ in wstring name,/* from ModelElement */ in wstring annotation,/* from GeneralizableElement */ in boolean is_root,/* from GeneralizableElement */ in boolean is_leaf,/* from GeneralizableElement */ in boolean is_abstract,/* from GeneralizableElement */ in ::Model::VisibilityKind visibility,/* from Class */ in boolean is_singleton)

   raises (Reflective::MofError); }; // end of interface ClassClass

    interface Class : ClassClass, Classifier { boolean is_singleton () raises (Reflective::MofError); void set_is_singleton (in boolean new_value) raises (Reflective::MofError); };

7.4.7 DataType (abstract)

    DataType is the superclass of the classes that represent MOF data types and data type constructors as described in 8.2, “MOF Values,? on page 139 . The DataType class, its subclasses and related classes are depicted in Figure 7.4.


   Figure 7.4 - MOF Data Type Elements SuperClasses

   Classifier

   © ISO/IEC 2005 - All rights reserved

   Contained Elements

    StructureField (for a StructureType only), Constraint, Tag. See DataTypeContainmentRules [C-17] on page 111.

   Attributes

   none

   Constraints

    Inheritance / generalization is not applicable to DataTypes. [C-19] on page 111.

    A DataType cannot be abstract. [C-20] on page 111.

   IDL

   interface DataTypeClass : ClassifierClass {

   readonly attribute DataTypeSet all_of_type_data_type;

   const string DATA_TYPE_CONTAINMENT_RULES =

   "org.omg.mof:constraint.model.data_type.data_type_containment_rules";

   const string DATA_TYPES_HAVE_NO_SUPERTYPES =

   "org.omg.mof:constraint.model.data_type.data_types_have_no_supertypes";

   const string DATA_TYPES_CANNOT_BE_ABSTRACT =

   "org.omg.mof:constraint.model.data_type.data_types_cannot_be_abstract";

   }; // end of interface DataTypeClass

    interface DataType : DataTypeClass, Classifier { };

7.4.8 PrimitiveType

   Instances of the PrimitiveType class are used to represent primitive data types in a meta-model. The MOF has a small number of built-in primitive data types that may be freely used in any meta-model. These types are defined as instances of PrimitiveType that are contained by the standard “PrimitiveTypes? package. Refer to 7.10, “The PrimitiveTypes Package,? on page 134 for details of the PrimitiveTypes package, and to 8.2, “MOF Values,? on page 139 for more details on data type semantics.

   The MOF built-in primitive data types map to different concrete data types in the context of each technology mapping. Each technology mapping is expected to support all of the standard built-in primitive data types.

   NOTE: A meta-model may contain PrimitiveType instances other than those defined in the “PrimitiveTypes? package. These instances denote technology specific, vendor specific or user defined primitive data types. They should not be used in technology neutral meta-models.

   SuperClasses

   DataType

   Contained Elements

   Constraint, Tag; see DataTypeContainmentRules [C-17] on page 111 .

   IDL

   interface PrimitiveTypeClass : DataTypeClass {

    readonly attribute PrimitiveTypeSet all_of_type_primitive_type;

    readonly attribute PrimitiveTypeSet all_of_class_primitive_type;

   DataType create_primitive_type (

   /* from ModelElement */ in wstring name,

   /* from ModelElement */ in wstring annotation,

   /* from GeneralizableElement */ in boolean is_root,

   /* from GeneralizableElement */ in boolean is_leaf,

   /* from GeneralizableElement */ in boolean is_abstract,

   /* from GeneralizableElement */ in ::Model::VisibilityKind visibility)

   raises (Reflective::MofError); }; // end of interface PrimitiveTypeClass

    interface PrimitiveType : PrimitiveTypeClass, DataType { };

7.4.9 CollectionType

   The CollectionType class is a type constructor for MOF collection types. A collection type is a data type whose values are finite collections of instances of some base type. The base type for a collection data type is given by the CollectionType instance’s ‘type’ value. The ‘multiplicity’ Attribute gives the collection type’s lower and upper bounds, and its orderedness and uniqueness properties.

   SuperClasses

   DataType, TypedElement

   Contained Elements

    Constraint, Tag; see DataTypeContainmentRules [C-17] on page 111.

   Attributes

   multiplicity

The multiplicity attribute of a CollectionType specifies upper and lower bounds on the size of a collection, and gives the ‘isOrdered’ and ‘isUnique’ flags that subclassify collections into ‘bags,’ ‘sets,’ ‘lists,’ and ‘ordered sets.’

type:

multiplicity:

MultiplicityType
exactly one

   IDL

    interface CollectionTypeClass : DataTypeClass, TypedElementClass { readonly attribute CollectionTypeSet all_of_type_collection_type; readonly attribute CollectionTypeSet all_of_class_collection_type; DataType create_collection_type (

   /* from ModelElement */ in wstring name, /* from ModelElement */ in wstring annotation, /* from GeneralizableElement */ in boolean is_root, /* from GeneralizableElement */ in boolean is_leaf, /* from GeneralizableElement */ in boolean is_abstract,

   /* from GeneralizableElement */ in ::Model::VisibilityKind visibility,

   /* from CollectionType */ in ::Model::MultiplicityType multiplicity)

    raises (Reflective::MofError); }; // end of interface CollectionTypeClass interface CollectionType : CollectionTypeClass, DataType, TypedElement { ::Model::MultiplicityType multiplicity() raises (Reflective::MofError); void set_multiplicity(in ::Model::MultiplicityType multiplicity) raises (Reflective::MofError); }; // end of interface CollectionType

7.4.10 EnumerationType

   The EnumerationType class is a type constructor for MOF enumeration types. An enumeration type is a data type whose values are the elements of a finite set of enumerators. The enumeration type is specified by defining an ordered set of enumerator labels.

   SuperClasses

   DataType

   Contained Elements

   Constraint, Tag; see DataTypeContainmentRules [C-17] on page 111 .

   Attributes

   labels

The labels attribute of an EnumerationType gives the names of the enumerators for the type. The label elements must be unique within the collection, and their order in the collection is significant.

type:

multiplicity:

String
one or more, ordered, unique

   IDL

   interface EnumerationTypeClass : DataTypeClass { readonly attribute EnumerationTypeSet all_of_type_enumeration_type; readonly attribute EnumerationTypeSet all_of_class_enumeration_type; DataType create_enumeration_type (

   /* from ModelElement */ in wstring name, /* from ModelElement */ in wstring annotation, /* from GeneralizableElement */ in boolean is_root, /* from GeneralizableElement */ in boolean is_leaf, /* from GeneralizableElement */ in boolean is_abstract, /* from GeneralizableElement */ in ::Model::VisibilityKind visibility, /* from EnumerationType */ in ::PrimitiveTypes::WStringUList labels)

    raises (Reflective::MofError); }; // end of interface EnumerationTypeClass

    interface EnumerationType : EnumerationTypeClass, DataType {

   ::PrimitiveTypes::WStringUList labels() raises (Reflective::MofError); void set_labels(in ::PrimitiveTypes::WStringUList labels) raises (Reflective::MofError); }; // end of interface EnumerationType

7.4.11 AliasType

   The AliasType class is a type constructor for MOF alias types. An alias type is a subtype of some other MOF class or data type, given by the ‘type’ value of the AliasType instance; i.e., a subset of the values of the type given by its ‘type.’ This subset is typically specified by attaching a Constraint to the AliasType instance. An alias type may convey a different “meaning? to that of its base type.

   SuperClasses

   DataType, TypedElement

   Contained Elements

    Constraint, Tag; see DataTypeContainmentRules [C-17] on page 111.

   IDL

    interface AliasTypeClass : DataTypeClass, TypedElementClass { readonly attribute AliasTypeSet all_of_type_alias_type; readonly attribute AliasTypeSet all_of_class_alias_type;DataType create_alias_type (

   /* from ModelElement */ in wstring name,/* from ModelElement */ in wstring annotation,/* from GeneralizableElement */ in boolean is_root,/* from GeneralizableElement */ in boolean is_leaf,/* from GeneralizableElement */ in boolean is_abstract,/* from GeneralizableElement */ in ::Model::VisibilityKind visibility)

   raises (Reflective::MofError);

   }; // end of interface AliasTypeClass

    interface AliasType : AliasTypeClass, DataType, TypedElement { };

7.4.12 StructureType

   The StructureType class is a type constructor for MOF structure data types. A structure type is a tuple type (i.e., a cartesian product) consisting of one or more fields. The fields are defined by StructureField instances contained by the StructureType instance.

   SuperClasses

   DataType

   Contained Elements

   StructureField, Constraint, Tag; see DataTypeContainmentRules [C-17] on page 111 .

   Constraints

   A StructureType must contain at least one StructureField. [C-59] on page 124 .

   IDL

    interface StructureTypeClass : DataTypeClass {readonly attribute StructureTypeSet all_of_type_structure_type;readonly attribute StructureTypeSet all_of_class_structure_type;const string MUST_HAVE_FIELDS =

   "org.omg.mof:constraint.model.structure_type.must_have_fields";

   DataType create_structure_type (/* from ModelElement */ in wstring name,/* from ModelElement */ in wstring annotation,/* from GeneralizableElement */ in boolean is_root,/* from GeneralizableElement */ in boolean is_leaf,/* from GeneralizableElement */ in boolean is_abstract,/* from GeneralizableElement */ in ::Model::VisibilityKind visibility)

    raises (Reflective::MofError); }; // end of interface StructureTypeClass

   interface StructureType : StructureTypeClass, DataType { };

7.4.13 StructureField

   The StructureField class is used to specify the fields of a StructureType instance.

   SuperClasses

   TypedElement

   Contained Elements

   Constraint, Tag; see StructureFieldContainmentRules [C-58] on page 124 .

   IDL

   interface StructureFieldClass : TypedElementClass { readonly attribute StructureFieldSet all_of_type_structure_field; readonly attribute StructureFieldSet all_of_class_structure_field; const string STRUCTURE_FIELD_CONTAINMENT_RULES =

   "org.omg.mof:constraint.modelstructure_field.structure_field_containment_rule";

   StructureField create_structure_field (/* from ModelElement */ in wstring name,/* from ModelElement */ in wstring annotation)

   raises (Reflective::MofError); }; // end of interface StructureFieldClass

   interface StructureField : StructureFieldClass, TypedElement { );

7.4.14 Feature (abstract)

   A Feature defines a characteristic of the ModelElement that contains it. Specifically, Classifiers are defined largely by a composition of Features. The Feature Class and its sub-Classes are illustrated in Figure 7.5.

   Model Element


   CanRaise

   Figure 7.5 - Feature Classes of the MOF Model

   SuperClasses

   ModelElement

   Attributes

   scope

The scope defines whether a Feature supports the definition of instances of the Classifier owning the Feature or of the Classifier as a whole. When scope is instanceLevel, the Feature is accessed through instances of the Feature’s owning Classifier; when scope is classifier, the Feature is accessed through the Classifier itself (or through its instances). For StructuralFeatures, a scope of instanceLevel indicates that a value represented by the StructuralFeature is associated with each instance of the Classifier; a scope of classifierLevel indicates that the StructuralFeature value is shared by the Classifier and all its instances.

type:

multiplicity:

ScopeKind
exactly one

   visibility

In the future, this Attribute will be used to limit the ability of ModelElements outside of this Feature’s container to make use of it; see 7.6.3, “VisibilityKind,? on page 97. The rules of visibility of MOF ModelElements are not currently specified.

type:

multiplicity:

VisibilityKind
exactly one

   IDL

   interface FeatureClass : ModelElementClass { readonly attribute FeatureSet all_of_type_feature; }; // end of interface FeatureClass

   interface Feature : FeatureClass, ModelElement { ScopeKind scope () raises (Reflective::MofError); void set_scope (in ScopeKind new_value) raises (Reflective::MofError); VisibilityKind visibility () raises (Reflective::MofError); void set_visibility (in VisibilityKind new_value) raises (Reflective::MofError); };

7.4.15 StructuralFeature (abstract)

   A StructuralFeature defines a static characteristic of the ModelElement that contains it. The attributes and references of a Class define structural properties, which provide for the representation of the state of its instances.

   SuperClasses

   Feature, TypedElement

   Attributes

   multiplicity

Multiplicity defines constraints on the collection of instances or values that a StructuralFeature can hold. Multiplicity defines a lower and upper bound to the cardinality of the collection, although the upper bound can be specified as Unbounded. Additionally multiplicity defines two other characteristics of the collection: 1) a constraint on collection member ordering, and 2) a constraint on collection member uniqueness. Specifically, Multiplicity contains an isOrdered field. When isOrdered is true, then the ordering of the elements in the set are preserved. Typically, a mechanism is provided for adding elements to the collection positionally. Multiplicity also has an isUnique field. When isUnique is true, then the collection is constrained to hold no more than one of any value or instance.

type:

multiplicity:

MultiplicityType
exactly one

   isChangeable

The isChangeable attribute places restrictions on the use of certain operations, which could change the set of values or instances of the StructuralFeature, and on the operations that will get generated in IDL or other language generation. For any elaboration, no means are automatically created that provides a means of altering the attribute value. When IDL is generated, for instance, the operations, that are normally generated for changing the StructuralFeature will not be generated. However, isChangeable does not actually constrain the StructuralFeature to make it immutable. Any operations explicitly defined in a model may change the StructuralFeature values or instances (assuming the operation would have otherwise been able to do so).

type:

multiplicity:

Boolean
exactly one

   IDL

   interface StructuralFeatureClass : FeatureClass, TypedElementClass { readonly attribute StructuralFeatureSet all_of_type_structural_feature; }; // end of interface StructuralFeatureClass

   interface StructuralFeature : StructuralFeatureClass, Feature, TypedElement {MultiplicityType multiplicity () raises (Reflective::MofError);void set multiplicity (in MultiplicityType new_value) raises (Reflective::MofError), boolean is_changeable () raises (Reflective::MofError);void set_is_changeable (in boolean new_value)raises (Reflective::MofError); };

7.4.16 Attribute (idl_substitute_name “MofAttribute?)

   An Attribute (referred to as a MofAttribute in the mapped IDL) defines a StructuralFeature that contains values for Classifiers or their instances.

   SuperClasses

   StructuralFeature

   Contained Elements

   None (not a Namespace)

   Attributes isDerived

A derived attribute is one whose values are not part of the state of the object instance, but whose values can be determined or computed. In a sense, all attributes are derived, since it is up to the class’s implementation to hold or calculate the values. However, by convention, isDerived indicates that the derived state is based on other information in the model. Modification of the derived Attribute causes the information upon which the Attribute is derived to be updated.

type:

multiplicity:

Boolean
exactly one

   IDL

   interface MofAttributeClass : StructuralFeatureClass {

    readonly attribute MofAttributeSet all_of_type_mof_attribute;

    readonly attribute MofAttributeSet all_of_class_mof_attribute;

   MofAttribute create_mof_attribute (

   /* from ModelElement */ in wstring name,

   /* from ModelElement */ in wstring annotation,

   /* from Feature */ in ::Model::ScopeKind scope,

   /* from Feature */ in ::Model::VisibilityKind visibility,

   /* from StructuralFeature */ in ::Model::MultiplicityType multiplicity,

   /* from StructuralFeature */ in boolean is_changeable,

   /* from MofAttribute */ in boolean is_derived)

    raises (Reflective::MofError);

   }; // end of interface MofAttributeClass

    interface MofAttribute : MofAttributeClass, StructuralFeature { boolean is_derived ()raises (Reflective::MofError); void set_is_derived (in boolean new_value) raises (Reflective::MofError); };

7.4.17 Reference

   A Reference defines a Classifier’s knowledge of, and access to, links and their instances defined by an Association. Although a Reference derives much of its state from a corresponding AssociationEnd, it provides additional information; therefore, the MOF cannot adequately represent some meta-models without this mechanism. The inherited attributes defined in StructuralFeature (multiplicity and is_changeable) are constrained to match the values of its corresponding AssociationEnd. However, it has its own visibility, name, and annotation defined. For further discussion on Reference, its purpose, and how it derives its attributes, see 7.2.2, “Associations,? on page 34.

   NOTE: When creating a Reference, values for the inherited attributes of multiplicity and is_changeable must be supplied. These must be the same as the corresponding attributes on the AssociationEnd to which the Reference will subsequently be linked.

   SuperClasses

   StructuralFeature

   References exposedEnd

The exposedEnd of a Reference is the AssociationEnd representing the end of the Reference’s owning Classifier within the defining Association.

class

defined by:

multiplicity:

changeable:

AssociationEnd
Exposes::exposedEnd
exactly one
yes

   referencedEnd

The referencedEnd of a Reference is the end representing the set of LinkEnds of principle interest to the Reference. The Reference provides access to the instances of that AssociationEnd’s class, which are participants in that AssociationEnd’s Association, connected through that AssociationEnd’s LinkEnds. In addition, the Reference derives the majority of its state information - multiplicity, etc., from that Reference.

class:

defined by:

multiplicity:

changeable:

AssociationEnd
RefersTo::referencedEnd
exactly one
yes

   Constraints

    The multiplicity for a Reference must be the same as the multiplicity for the referenced AssociationEnd. [C-21] on page

    112. Classifier scoped References are not meaningful in the current M1 level computational model. [C-22] on page 112. A Reference can be changeable only if the referenced AssociationEnd is also changeable. [C-23] on page 112. The type attribute of a Reference and its referenced AssociationEnd must be the same. [C-24] on page 113 . A Reference is only allowed for a navigable AssociationEnd. [C-25] on page 113. The containing Class for a Reference must be equal to or a subtype of the type of the Reference’s exposed

   AssociationEnd. [C-26] on page 113 . The referenced AssociationEnd for a Reference must be visible from the Reference. [C-27] on page 114.

   IDL

   interface ReferenceClass : StructuralFeatureClass { readonly attribute ReferenceSet all_of_type_reference; readonly attribute ReferenceSet all_of_class_reference; const string REFERENCE_MULTIPLICITY_MUST_MATCH_END =

   "org.omg.mof:constraint.model.reference.reference_multiplicity_must_match_end"; const string REFERENCE_MUST_BE_INSTANCE_SCOPED ="org.omg.mof:constraint.model.reference.reference_must_be_instance_scoped"; const string CHANGEABLE_REFERENCE_MUST_HAVE_CHANGEABLE_END ="org.omg.mof:constraint.model.reference.changeable_reference_must_have_changeable_end"; const string REFERENCE_TYPE_MUST_MATCH_END_TYPE ="org.omg.mof:constraint.model.reference.reference_type_must_match_end_type"; const string REFERENCED_END_MUST_BE_NAVIGABLE ="org.omg.mof:constraint.model.reference.referenced_end_must_be_navigable"; const string CONTAINER_MUST_MATCH_EXPOSED_TYPE ="org.omg.mof:constraint.model.reference.container_must_match_exposed_type"; const string REFERENCED_END_MUST_BE_VISIBLE ="org.omg.mof:constraint.model.reference.referenced_end_must_be_visible";

    Reference create_reference (/* from ModelElement */ in wstring name,/* from ModelElement */ in wstring annotation,/* from Feature */ in ::Model::ScopeKind scope,/* from Feature */ in ::Model::VisibilityKind visibility,/* from StructuralFeature */ in ::Model::MultiplicityType, multiplicity,/* from StructuralFeature */ in boolean is_changeable)

    raises (Reflective::MofError);}; // end of interface ReferenceClass

    interface Reference : ReferenceClass, StructuralFeature { AssociationEnd exposed_end () raises (Reflective::MofError); void set_exposed_end (in AssociationEnd new_value)

    raises (Reflective::MofError); AssociationEnd referenced_end () raises (Reflective::MofError);

    void set_referenced_end (in AssociationEnd new_value) raises (Reflective::MofError); };

7.4.18 BehavioralFeature (abstract)

   A BehavioralFeature defines a dynamic characteristic of the ModelElement that contains it. Because a BehavioralFeature is partially defined by the Parameters it contains, it is both a Feature and a Namespace.

   SuperClasses

   Feature, Namespace

   IDL

   interface BehavioralFeatureClass : FeatureClass, NamespaceClass { readonly attribute BehavioralFeatureUList all_of_type_behavioral_feature;

   }; // end of interface BehavioralFeatureClass

   interface BehavioralFeature : BehavioralFeatureClass, Feature , Namespace {};

7.4.19 Operation

   An Operation defines a dynamic feature that offers a service. The behavior of an operation is activated through the invocation of the operation.

   SuperClasses

   BehavioralFeature

   Contained Elements

    Parameter, Constraint; see OperationContainmentRules [C-28] on page 114.

   Attributes isQuery

Defining an Operation with an isQuery value of true denotes that the behavior of the operation will not alter the state of the object. The state of a Classifier, for this definition, is the set of values of all of the Classifier’s class-scope and instance-scope StructuralFeatures. For instance, an Operation of a Class, defined with a scope of instance, will not change the values or instances of any instance-scope StructuralFeature of the Class instance, as a result of invoking this Operation. An Operation of a Class with a scope of classifier will not change the values or instances of any of the classifier-scope StructuralFeatures or instance-scope StructuralFeatures. This attribute does not define a constraint enforced by the model, but rather a promise that the operation’s implementation is expected to uphold. An operation that is not defined as isQuery equals false is not guaranteed to change the state of its object. The isQuery constraint does not proscribe any specific implementation, so long as the definition of isQuery above is observed.

type:

multiplicity:

Boolean
exactly one

   References exceptions Constraints

An Operation, upon encountering an error or other abnormal condition, may raise an Exception. The exceptions reference provides the Operation with the set of Exceptions it is allowed to raise.

class:

defined by:

multiplicity:

Exception
CanRaise::except
zero or more, ordered

    An Operation may only contain Parameters, Constraints, and Tags. [C-28] on page 114.

    An Operation may have at most one Parameter whose direction is “return.? [C-29] on page 114.

    The Exceptions raised by an Operation must be visible to the Operation. [C-30] on page 115.

   IDL

   interface OperationClass : BehavioralFeatureClass { readonly attribute OperationSet all_of_type_operation; readonly attribute OperationSet all_of_class_operation; const string OPERATION_CONTAINMENT_RULES =

   "org.omg.mof:constraint.model.operation.operation_containment_rules"; const string OPERATIONS_HAVE_AT_MOST_ONE_RETURN ="org.omg.mof:constraint.model.operation.operations_have_at_most_one_return"; const string OPERATION_EXCEPTIONS_MUST_BE_VISIBLE ="org.omg.mof:constraint.model.operation.operation_exceptions_must_be_visible";

    Operation create_operation (/* from ModelElement */ in wstring name,/* from ModelElement */ in wstring annotation,/* from Feature */ in ::Model::ScopeKind scope,/* from Feature */ in ::Model::VisibilityKind visibility,/* from Operation */ in boolean is_query)

   raises (Reflective::MofError); }; // end of interface OperationClass

    interface Operation : OperationClass, BehavioralFeature { boolean is_query ()raises (Reflective::MofError); void set_is_query (in boolean new_value) raises (Reflective::MofError); MofExceptionUList exceptions ()raises (Reflective::MofError);void set_exceptions (in MofExceptionUList new_value) raises (Reflective::MofError); void add_exceptions (in MofException new_element) raises (Reflective::MofError); void add_exceptions_before (in MofException new_element, in MofException before_element) raises (Reflective::NotFound, Reflective::MofError);void modify_exceptions (in MofException old_element, in MofException new_element)

    raises (Reflective::NotFound, Reflective::MofError); void remove_exceptions (in MofException old_element) raises (Reflective::NotFound, Reflective::MofError);

    };

7.4.20 Exception (idl_substitute_name “MofException?)

   An Exception (referred to as a MofException in the mapped IDL) defines an error or other abnormal condition. The Parameters of an Exception hold a record of an occurrence of the exceptional condition.

   SuperClasses

   BehavioralFeature

   Contained Elements

   Parameter; see ExceptionContainmentRules [C-31] on page 115 .

   Constraints

    An Exception may only contain Parameters and Tags. [C-31] on page 115.

    An Exception’s Parameters must all have the direction “out.? [C-32] on page 115.

   IDL

   interface MofExceptionClass : BehavioralFeatureClass { readonly attribute MofExceptionSet all_of_type_mof_exception; readonly attribute MofExceptionSet all_of_class_mof_exception; const string EXCEPTION_CONTAINMENT_RULES =

    "org.omg.mof:constraint.model.mof_exception.exception_containment_rules";const string EXCEPTIONS_HAVE_ONLY_OUT_PARAMETERS = "org.omg.mof:constraint.model.mof_exception.exceptions_have_only_out_parameters";

    MofException create_mof_exception (/* from ModelElement */ in wstring name,/* from ModelElement */ in wstring annotation,/* from Feature */ in ::Model::ScopeKind scope,/* from Feature */ in ::Model::VisibilityKind visibility)

   raises (Reflective::MofError); }; // end of interface MofExceptionClass

   interface MofException : MofExceptionClass, BehavioralFeature {};

7.4.21 Association

   An association defines a classification over a set of links, through a relationship between Classifiers. Each link that is an instance of the association denotes a connection between object instances of the Classifiers of the Association. The MOF restricts associations to binary, restricting each link to two participating objects. This restriction also means that the association is defined between two Classifiers (which may be the same Classifier). The name of the Association is considered directional if it provides a clearer or more accurate representation of the association when stated with one participating class first rather than the other. For instance, Operation CanRaise Exception is correct; Exception CanRaise Operation is incorrect.

   An Association contains at least two AssociationEnds, each of which has a Class as its “type.? A Class has knowledge of its participation in an Association if it contains a Reference that is related to the Association’s Ends, as shown in Figure 7.6. The “type? of a Reference must be the “type? of the AssociationEnd that is the Reference’s “referencedEnd.? The “type? of the Reference’s “exposedEnd? must be the Reference’s containing Class, or a supertype of that Class.

   Model Element


   Figure 7.6 - MOF Model Elements for Associations

   SuperClasses

   Classifier

   Contained Elements

   AssociationEnd, Constraint; see AssociationContainmentRules [C-33] on page 116 .

   Attributes isDerived

A derived association has no Links as instances. Instead, its Links are derived from other information in a meta-model. The addition, removal, or modification of a derived Association’s Link causes the information upon which the Association is derived to be updated. The results of such an update are expected to appear, upon subsequent access of the derived Association’s Links, to have the same effect as an equivalent operation on an Association that is not derived.

type:

multiplicity:

Boolean
exactly one

   Constraints

    An Association may only contain AssociationEnds, Constraints, and Tags. [C-33] on page 116.

    Inheritance / generalization is not applicable to Associations. [C-34] on page 116.

   The values for “isLeaf? and “isRoot? on an Association must be true. [C-35] on page 116 .

    An Association cannot be abstract. [C-36] on page 117.

    Associations must have visibility of “public.? [C-37] on page 117.

    An Association must not be unary; that is, it must have at least two AssociationEnds. [C-38] on page 117.

   IDL

   interface AssociationClass : ClassifierClass { readonly attribute AssociationSet all_of_type_association; readonly attribute AssociationSet all_of_class_association; const string ASSOCIATIONS_CONTAINMENT_RULES =

    "org.omg.mof:constraint.model.association.associations_containment_rules";const string ASSOCIATIONS_HAVE_NO_SUPERTYPES = "org.omg.mof:constraint.model.association.associations_have_no_supertypes";const string ASSOCIATIONS_MUST_BE_ROOT_AND_LEAF = "org.omg.mof:constraint.model.association.associations_must_be_root_and_leaf";const string ASSOCIATIONS_CANNOT_BE_ABSTRACT = "org.omg.mof:constraint.model.association.associations_cannot_be_abstract";const string ASSOCIATIONS_MUST_BE_PUBLIC = "org.omg.mof:constraint.model.association.associations_must_be_public";const string ASSOCIATIONS_MUST_BE_BINARY = "org.omg.mof:constraint.model.association.associations_must_be_binary";

    Association create_association (/* from ModelElement */ in wstring name,/* from ModelElement */ in wstring annotation,/* from GeneralizableElement */ in boolean is_root,/* from GeneralizableElement */ in boolean is_leaf,/* from GeneralizableElement */ in boolean is_abstract,/* from GeneralizableElement */ in ::Model::VisibilityKind visibility,/* from Association */ in boolean is_derived)

   raises (Reflective::MofError); }; // end of interface AssociationClass

   interface Association : AssociationClass, Classifier {

    boolean is_derived () raises (Reflective::MofError); void set_is_derived (in boolean new_value) raises (Reflective::MofError); };

7.4.22 AssociationEnd

   An association is composed of two AssociationEnds. Each AssociationEnd defines a Classifier participant in the Association, the role it plays, and constraints on sets of the Classifier instances participating. An instance of an AssociationEnd is a LinkEnd, which defines a relationship between a link, in instance of an Association, and an instance of the AssociationEnd’s Classifier, provided in its type attribute.

   SuperClasses

   TypedElement

   Attributes isNavigable

The isNavigable attribute determines whether or not the AssociationEnd supports link “navigation.? This has two implications: • A Class defined with an appropriate Reference supports navigation of links from one Class instance to another. If isNavigable is false for an AssociationEnd, no such References may be created. • Setting isNavigable to false also suppress as a mapping’s mechanisms for indexing links based on this AssociationEnd.

type:

multiplicity:

Boolean
exactly one

   aggregation

Certain associations define aggregations - directed associations with additional semantics (see 8.10, “Aggregation Semantics,? on page 152). When an AssociationEnd is defined as composite or shared, the instance at “this? end of a Link is the composite or aggregate, and the instance at the “other? end is the component or subordinate.

type:

multiplicity:

AggregationKind
exactly one

   multiplicity

Multiplicity defines constraints on sets of instances. Each instance of the Classifier defined by the opposite AssociationEnd’s type defines a set that this multiplicity attribute constrains. Given one of those instances, x, the set is defined as the instances connected by LinkEnds of this AssociationEnd to that instance x. Refer to 7.6.1, “PrimitiveTypes used in the MOF Model,? on page 96 for a description on how the multiplicity attribute constrains a set. In its use is describing AssociationEnds, isUnique has been constrained to be true, as a simplification. This constraint means that the same two instances cannot participate in more than one Link while participating under the same AssociationEnd. Normally, two instances cannot be linked by more than one Link of an Association at all. But when the AssociationEnd types allow the two instances switch ends, they can form a second Link without violating the isUnique constraint.

type:

multiplicity:

MultiplicityType
exactly one

   isChangeable

The isChangeable attribute restricts the capability to perform actions that would modify sets of instances corresponding to this AssociationEnd (the same sets to which multiplicity is applied). Specifically, the set may be created when the instance defining the set - the instance at the opposite end of the Links - is created. This attribute does not make the set immutable. Instead, it affects the generation of operations in Model Elaboration that would allow modification of the set. For IDL generation, the only operation that allows the set to be modified would be one or more factory operations that create the instance and create the set. The modeler is free to define specific operations that allow modification of the set. Note that defining this AssociationEnd with isChangeable equals false places restrictions on the changeability of the other AssociationEnd, due to their interdependence.

type:

multiplicity:

Boolean
exactly one

   Operations otherEnd

Provides the other AssociationEnd (i.e., not this one) in the enclosing Association.

return type:

isQuery:

parameters:

operation semantics:

AssociationEnd
yes
none
[S-2] on page 125

   Constraints

   The type of an AssociationEnd must be Class. [C-39] on page 117 .

   The “isUnique? flag in an AssociationEnd’s multiplicity must be true. [C-40] on page 118 .

    An Association cannot have two AssociationEnds marked as “ordered.? [C-41] on page 118.

    An Association cannot have an aggregation semantic specified for both AssociationEnds. [C-42] on page 118.

   IDL

   interface AssociationEndClass : TypedElementClass { readonly attribute AssociationEndSet all_of_type_association_end; readonly attribute AssociationEndSet all_of_class_association_end; const string END_TYPE_MUST_BE_CLASS = "org.omg.mof:constraint.model.association_end.end_type_must_be_class"; const string ENDS_MUST_BE_UNIQUE = "org.omg.mof:constraint.model.association_end.ends_must_be_unique"; const string CANNOT_HAVE_TWO_ORDERED_ENDS = "org.omg.mof:constraint.model.association_end.cannot_have_two_ordered_ends"; const string CANNOT_HAVE_TWO_AGGREGATE_ENDS = "org.omg.mof:constraint.model.association_end.cannot_have_two_aggregate_ends";

   AssociationEnd create_association_end (/* from ModelElement */ in wstring name,

   /* from ModelElement */ in wstring annotation,

   /* from AssociationEnd */ in boolean is_navigable,

   /* from AssociationEnd */ in ::Model::AggregationKind aggregation,

   /* from AssociationEnd */ in ::Model::MultiplicityType multiplicity,

   /* from AssociationEnd */ in boolean is changeable)

    raises (Reflective::MofError); }; // end of interface AssociationEndClass

   interface AssociationEnd : AssociationEndClass, TypedElement { boolean is_navigable () raises (Reflective::MofError); void set_is_navigable (in boolean new_value) raises (Reflective::MofError); AggregationKind aggregation () raises (Reflective::MofError); void set_aggregation (in AggregationKind new_value) raises (Reflective::MofError); MultiplicityType multiplicity () raises (Reflective::MofError); void set_multiplicity (in MultiplicityType new_value) raises (Reflective::MofError); boolean is changeable () raises (Reflective::MofError); void set is changeable (in boolean new value); AssociationEnd other_end () raises (Reflective::MofError); }; // end of interface AssociationEnd

7.4.23 Package

   A Package is a container for a collection of related ModelElements that form a logical meta-model. Packages may be composed and related in the following ways:

   The model elements for representing Packages are shown in Figure 7.7.

   Model Element


   Figure 7.7- MOF Model Packaging

   SuperClasses

   GeneralizableElement

   Contained Elements

    Package, Class, Association, DataType, Exception, Import, Constraint, Constant; see PackageContainmentRules [C-43] on page 119 .

   Operations

   none

   Constraints

   A Package may only contain Packages, Classes, DataTypes, Associations, Exceptions, Constants, Constraints, Imports, and Tags. [C-43] on page 119 .

   Packages cannot be declared as abstract. [C-44] on page 119 .

   IDL

   interface PackageClass : GeneralizableElementClass { readonly attribute PackageSet all_of_type_package; readonly attribute PackageSet all_of_class_package; const string PACKAGE_CONTAINMENT_RULES =

   "org.omg.mof:constraint.model.package.package_containment_rules";const string PACKAGES_CANNOT_BE_ABSTRACT ="org.omg.mof:constraint.model.package.packages_cannot_be_abstract";

   Package create_package (/* from ModelElement */ in wstring name,/* from ModelElement */ in wstring annotation,

   /* from GeneralizableElement */ in boolean is_root,

   /* from GeneralizableElement */ in boolean is_leaf,

   /* from GeneralizableElement */ in boolean is_abstract,

   /* from GeneralizableElement */ in ::Model::VisibilityKind visibility)

    raises (Reflective::MofError); }; // end of interface PackageClass

    interface Package : PackageClass, GeneralizableElement { };

7.4.24 Import

   An Import allows a Package to make use of ModelElements defined in some other Namespace. An Import object is related to another Namespace via the Aliases association. When a Package contains an Import object, it imports the associated Namespace. This means that ModelElements defined within the imported Namespace are visible in the importing Package.

   An Import allows the visibility of the imported Package’s contained ModelElements to be further restricted. An Import object represents either Package importing or Package clustering, depending on the “isClustered? attribute.

   SuperClasses

   ModelElement

   Attributes

   visibility

In the future, this Attribute will modify the visibility of imported ModelElements in the context of the importing Namespace. For a description of visibility kinds, see 7.6.3, “VisibilityKind,? on page 97. The MOF rules of visibility are not currently specified.

type:

multiplicity:

VisibilityKind
exactly one

   isClustered ISO/IEC 19502:2005(E)

The isClustered flag determines whether the Import object represents simple Package importation, or Package clustering.

type:

multiplicity:

Boolean
exactly one

   References importedNamespace

The Import knows about the Namespace that it references.

class:

defined by:

multiplicity:

Namespace
Aliases::imported
exactly one

   Constraints

    The Namespace imported by an Import must be visible to the Import’s containing Package. [C-45] on page 119.

    It is only legal for a Package to import or cluster Packages or Classes. [C-46] on page 120.

    Packages cannot import or cluster themselves. [C-47] on page 120.

   Packages cannot import or cluster Packages or Classes that they contain. [C-48] on page 120 .

    Nested Packages cannot import or cluster other Packages or Classes. [C-49] on page 121, [C-9] on page 108.

   IDL

   interface ImportClass : ModelElementClass { readonly attribute ImportSet all_of_type_import; readonly attribute ImportSet all_of_class_import;

    const string IMPORTED_NAMESPACE_MUST_BE_VISIBLE = "org.omg.mof:constraint.model.import.imported_namespace_must_be_visible";const string CAN_ONLY_IMPORT_PACKAGES_AND_CLASSES = "org.omg.mof:constraint.model.import.can_only_import_packages_and_classes";const string CANNOT_IMPORT_SELF = "org.omg.mof:constraint.model.import.cannot_import_self";const string CANNOT_IMPORT_NESTED_COMPONENTS = "org.omg.mof:constraint.model.import.cannot_import_nested_components";const string NESTED_PACKAGES_CANNOT_IMPORT = "org.omg.mof:constraint.model.import.nested_packages_cannot_import";

   Import create_import ( /* from ModelElement */ in wstring name, /* from ModelElement */ in wstring annotation, /* from Import */ in ::Model::VisibilityKind visibility, /* from Import */ in boolean is_clustered)

   raises (Reflective::MofError); }; // end of interface ImportClass

   interface Import : ImportClass, ModelElement { VisibilityKind visibility () raises (Reflective::MofError);void set_visibility (in VisibilityKind new_value) raises (Reflective::MofError); boolean is_clustered () raises (Reflective::MofError);void set_is_clustered (in boolean new_value) raises (Reflective::MofError);

    Namespace imported_namespace () raises (Reflective::MofError); void set_imported_namespace (in Namespace new_value) raises (Reflective::MofError); };

   +modelElement

   +constrainedElement

   Model Element

   AttachesTo


   Figure 7.8 - MOF Model - Other Elements

7.4.25 Parameter

   A parameter provides a means of communication with operations and other BehavioralFeatures. A parameter passes or communicates values of its defined type.

   SuperClasses

   TypedElement

   Attributes direction

This attribute specifies the purpose of the parameter; to input a value, to output a value, both purposes, or to provide an operation return value.

type:

multiplicity:

DirectionKind
exactly one

   multiplicity

Multiplicity defines cardinality constraints on the set of instances or values that a Parameter can hold. Multiplicity defines a lower and upper bound on the set, although the upper bound can be specified as Unbounded. Additionally, multiplicity defines two other characteristics of the set: 1) constraints on set member ordering, and 2) constraints on unique set elements. Specifically, Multiplicity contains an isOrdered field. When isOrdered is true, the ordering of the elements in the set are preserved. Multiplicity also has an isUnique field. When isUnique is true, the set is constrained to hold no more than one of any value or instance.

type:

multiplicity:

MultiplicityType
exactly one

   IDL

   interface ParameterClass : TypedElementClass {

    readonly attribute ParameterSet all_of_type_parameter;

    readonly attribute ParameterSet all_of_class_parameter;

   Parameter create_parameter (

    /* from ModelElement */ in wstring name,

    /* from ModelElement */ in wstring annotation,

    /* from Parameter */ in ::Model::DirectionKind direction,

    /* from Parameter */ in ::Model::MultiplicityType multiplicity)

    raises (Reflective::MofError);

    }; // end of interface ParameterClass

   interface Parameter : ParameterClass, TypedElement { DirectionKind direction () raises (Reflective::MofError); void set_direction (in DirectionKind new_value) raises (Reflective::MofError); MultiplicityType multiplicity () raises (Reflective::MofError); void set_multiplicity (in MultiplicityType new_value) raises (Reflective::MofError); };

7.4.26 Constraint

   A Constraint defines a rule that restricts the state or behavior of one or more elements in the meta-model. When a Constraint is attached to a ModelElement, the rule it encodes applies to all relevant instances of the ModelElement in a model.

   A Constraint rule, represented by the “expression? attribute, may be encoded in any form. The “language? attribute may be used to denote the language and encoding scheme used.

   While some Constraints on a model may need to be treated as invariant, it is often convenient for other Constraints to be relaxed, for instance while a model is being edited. While, the “evaluationPolicy? attribute is used to represent these two cases, this information is at best advisory, since the MOF specification does not currently state how and when Constraints should be enforced.

   NOTE: A Constraint cannot override structural integrity rules defined by other parts of a meta-model (e.g., multiplicity specifications) or the integrity rules defined by a particular mapping of the meta-model to implementation technology.

   SuperClasses

   ModelElement

   Attributes expression

The Constraint’s expression attribute contains a textual representation of the constraint. The MOF has no specific requirement that an implementation must be able to interpret this expression, or to validate it against the language attribute. The meaning of the expression will depend on the language used.

type

multiplicity:

String
exactly one

   language

A Constraint’s language attribute gives the name of textual language used in the constraint expression.

type:

multiplicity:

String
exactly one

   evaluationPolicy

Each constraint can be defined as immediate or deferred. For immediate Constraints, the constraint violation will be detected and reported within an operation in the chain of operations between the operation initiated by the MOF user and the operation that caused the constraint violation. The effect of an operation that violates an immediate constraint on the state of the object or objects being altered is implementation specific, and possibly undefined. However, if possible, an implementation should reverse the effects of the operation. For deferred Constraints, the constraint violation can only be detected when the Constraint is explicitly evaluated. A technology mapping will typically provide a verify operation. When a verify operation is invoked on instance of a constrained element, the Constraint will be checked and any violation will be reported.

type:

multiplicity:

EvaluationKind
exactly one

    ISO/IEC 19502:2005(E)

   References constrainedElements

The Constraint has access to the ModelElements it constrains, through this reference. Note that the Constraint may depend on other ModelElements not represented in this reference. For instance, a Constraint may state that attribute A::x cannot exceed A::y in magnitude. The Constraint is on A::x, although it also depends on A::y. The relationship between the Constraint and A::y is not explicitly stated in the meta-model.

class:

defined by:

multiplicity:

ModelElement
Constrains::constrainedElement
one or more

   Constraints

   Constraints, Tags, Imports, and Constants cannot be constrained. [C-50] on page 121 .

    A Constraint can only constrain ModelElements that are defined by or inherited by its immediate container. [C-51] on page 122 .

   IDL

   interface ConstraintClass : ModelElementClass {

    readonly attribute ConstraintSet all_of_type_constraint;

    readonly attribute ConstraintSet all_of_class_constraint;

    const string CANNOT_CONSTRAIN_THIS_ELEMENT =

    "org.omg.mof:constraint.model.constraint.cannot_constrain_this_element";

    const string CONSTRAINTS_LIMITED_TO_CONTAINER =

    "org.omg.mof:constraint.model.constraint.constraints_limited_to_container";

   enum EvaluationKind {immediate, deferred};

    Constraint create_constraint (

   /* from ModelElement */ in wstring name,

   /* from ModelElement * in wstring annotation,

   /* from Constraint */ in wstring expression,

   /* from Constraint */ in wstring language,

   /* from Constraint */ in ::Model::ConstraintClass::EvaluationKind evaluation_policy)

   raises (Reflective::MofError);

    }; // end of interface ConstraintClass

   interface Constraint : ConstraintClass, ModelElement { wstring expression () raises (Reflective::MofError);void set_expression (in wstring new_value) raises (Reflective::MofError); wstring language () raises (Reflective::MofError);void set_language (in wstring new_value)raises (Reflective::MofError);ConstraintClass::EvaluationKind evaluation_policy () raises (Reflective::MofError);void set_evaluation_policy (in ConstraintClass::EvaluationKind new_value)

    raises (Reflective::MofError); ModelElementSet constrained_elements () raises (Reflective::MofError);void set_constrained_elements (in ModelElementSet new_value)raises (Reflective::MofError); void add_constrained_elements (in ModelElement new_element)raises (Reflective::MofError); void modify_constrained_elements (in ModelElement old_element, in ModelElement new_element) raises (Reflective::NotFound, Reflective::MofError); void remove_constrained_elements (in ModelElement old_element) raises (Reflective::NotFound, Reflective::MofError); };

7.4.27 Constant

   Constant provides a mechanism for defining constant values for use in meta-models. Constants are limited to values of types defined as PrimitiveType instances.

   SuperClasses

   TypedElement

   Attributes

   value

This Attribute gives the literal value of the constant encoded as text. The syntax for encoding literal values of the standard MOF primitive data types is given in 7.10, “The PrimitiveTypes Package,? on page 134. Other encodings are mapping, vendor or user specific.

type

multiplicity:

String
exactly one

   Constraints

   The type of a Constant and its value must be compatible. [C-52] on page 122 .

   The type of a Constant must be a PrimitiveType. [C-53] on page 122 .

   IDL

   interface ConstantClass : TypedElementClass { readonly attribute ConstantSet all_of_type_constant; readonly attribute ConstantSet all_of_class_constant; const string CONSTANTS_VALUE_MUST_MATCH_TYPE =

   "org.omg.mof:constraint.model.constant.constants_value_must_match_type"; const string CONSTANTS_TYPE_MUST_BE_SIMPLE_DATA_TYPE = "org.omg.mof:constraint.model.constant.constants_type_must_be_simple_data_type";

   Constant create_constant ( /* from ModelElement */ in wstring name, /* from ModelElement */ in wstring annotation,

   /* from Constant */ in wstring value) raises (Reflective::MofError); }; // end of interface ConstantClass

    interface Constant : ConstantClass, TypedElement { wstring value () raises (Reflective::MofError); void set_value (in wstring new_value)raises (Reflective::MofError); };

7.4.28 Tag

   Tags provide a light-weight extension mechanism that allows mapping, vendor, and even customer specific information to be added to, or associated with a meta-model. In essence, Tags are arbitrary name / value pairs that can be attached to instances of most ModelElements.

   A Tag has an attribute called “tagId? that denotes a category of meaning, and another attribute called “values? that parameterizes that meaning. Each Tag is related to one or more ModelElements by the AttachesTo Association. The Tag need not be contained within the meta-model of the ModelElement it “tags.?

   The MOF specification does not generally define the values for the “tagId? or the application specific categories of meaning that they denote. The exception to this is:

   • 9.6, “Standard Tags for the IDL Mapping,? on page 194 defines some Tags that tailor the IDL produced by the IDLmapping.

   Since “tagId? values are not standardized, there is a risk that different vendors or user organizations will use the same values to denote different categories of meaning. If a “tagId? value is used to mean different things, problems can arise when meta-models using the value are exchanged.

   To avoid such Tag collisions, it is recommended that “tagId? values should use the following scheme based on Java package naming. Each value should start with a prefix formed by reversing the Internet domain name of a “tagId? naming authority. This should be followed by a locally unique component. For instance, this might be a standard or product name followed by a name or names that denotes the meaning. Here are some examples:

   "org.omg.mof.idl_prefix""org.omg.mof.some_tag""com.rational.rose.screen_position""au.edu.dstc.elvin.event_type"

   It is also recommended that “tagId? values should be spelled in all lower case using the underscore (“_?) character as a word separator.

   NOTE: In defining new Tag categories, the meta-modeler should take account of the fact that the MOF Model has no Reference for navigating from a ModelElement to its attached Tags. This allows one to attach Tags to elements of a “frozen? meta-model. On the other hand, it makes it harder for a “client? of the meta-model objects to find the Tags for an element. One option is to require relevant Tags to be Contained by the elements they AttachTo, or their parents.

   SuperClasses

   ModelElement

   Attributes tagId

Gives the category of meaning for the Tag. The values for this attribute and their associated meanings are not standardized here. See discussion above.

type:

multiplicity:

String
exactly one

   values

Carries additional information (e.g., “parameters?) associated with the Tag. The encoding of parameters as String values is tagId specific.

type:

multiplicity:

String
zero or more, ordered.

   References elements

The ModelElement or ModelElements that this Tag is attached to.

class:

defined by:

multiplicity:

ModelElement
AttachesTo::modelElement
one or more

   IDL

   interface TagClass : ModelElementClass { readonly attribute TagSet all_of_type_tag; readonly attribute TagSet all_of_class_tag;

    Tag create_tag ( /* from ModelElement */in wstring name, /* from ModelElement */in wstring annotation,

    /* from Tag */ in wstring tag_id, /* from Tag */ in ::PrimitiveTypes::WStringList values) raises (Reflective::MofError); }; // end of interface TagClass

    interface Tag : TagClass, ModelElement {wstring tag_id ()

   raises (Reflective::MofError);void set_tag_id (in wstring new_value)raises (Reflective::MofError);::PrimitiveTypes::WStringList values ()raises (Reflective::MofError);

   void set_values (in ::PrimitiveTypes::WStringList new_value) raises (Reflective::MofError); void add_values (in wstring new_element)

   raises (Reflective::MofError);

   void add_values_at(in wstring new_element, in unsigned long position)

   raises (Reflective::BadPosition, Reflective::MofError);

   void modify_values (in wstring old_element, in wstring new_element)

   raises (Reflective::NotFound, Reflective::MofError);

   void modify_values_at(in wstring new_element, in unsigned long position)

   raises (Reflective::BadPosition, Reflective::MofError);

   void remove_values (in wstring old_element)

   raises (Reflective::NotFound, Reflective::MofError);

   void remove_values_at(in unsigned long position)

   raises (Reflective::BadPosition, Reflective::MofError);

   ModelElementUList elements ()

   raises (Reflective::MofError);

   void set_elements (in ModelElementUList new_value)

    raises (Reflective::MofError);

    void add_elements (in ModelElement new_element)

    raises (Reflective::MofError);

   void add_elements_before (in ModelElement new_element, in ModelElement before_element)

   raises (Reflective::NotFound, Reflective::MofError);

   void modify_elements (in ModelElement old_element, in ModelElement new_element)

   raises (Reflective::NotFound, Reflective::MofError);

    void remove_elements (in ModelElement old_element)

   raises (Reflective::NotFound, Reflective::MofError);

    };