Previous Table of Contents Next


7.3 The Structure of the MOF Model

   This sub clause gives an overview of the structure of the MOF Model.

7.3.1 The MOF Model Package

   The MOF Model, as it is currently defined, consists of a single non-nested Package called “Model.? This Package explicitly imports the “PrimitiveTypes? Package so that it can use the “Boolean,? “Integer,? and “String? PrimitiveType instances.

   The class diagram in Figure 7.2 on page 39 shows the Classes and Associations of the “Model? Package. To aid readability, Class features, Association End names, DataTypes, and other details have been omitted from the diagram. These details are all specified in later sub clauses of this clause.

   NOTE: This diagram (like other UML diagrams in this clause) is non-normative.


   Figure 7.1 - The MOF Model Package

7.3.2 The MOF Model Service IDL

   The “Model? Package is used to generate the CORBA IDL for the OMG MOF Model service using the MOF to IDL Mapping defined in the “MOF Abstract Mapping? clause through the “Reflective Module? clause. Relevant fragments of the resulting IDL is embedded in the Class, Association, DataType, and Exception descriptions in 7.4, “MOF Model Classes,? on page 41 through 7.7, “MOF Model Exceptions,? on page 99.

   The IDL for the MOF Model service requires a “prefix? of “org.omg.mof.? To this end, the “Model? Package is defined to have an “idl_prefix? Tag with value “org.omg.mof.?

   The IDL for the MOF Model services requires the “Attribute? and “Exception? elements to have IDL names “MofAttribute? and “MofException? respectively to avoid collision with IDL keywords. To this end, the “Attribute? Class and “Exception? Class have ‘idl_alternate_name? Tags with the values “MofAttribute? and “MofException? respectively.

7.3.3 The MOF Model Structure

    The core structure of the MOF Model is shown in the class diagram in Figure 7.2. This diagram shows the key abstract Classes in the MOF Model and the key Associations between them.

7.3.3.1 Key Abstract Classes

   The key abstract Classes in the MOF Model are as follows:

7.3.3.2 Key Associations

   The key Associations in the MOF Model are as follows:


   Figure 7.2 - The Key Abstractions of the MOF Model

7.3.4 The MOF Model Containment Hierarchy

   The most important relationship in the MOF Model is the Contains Association. Containment is a utility Association that is used to relate (for example) Classes to their Operations and Attributes, Operations to their Parameters, and so on. While the class diagram shows that only ModelElement objects that are subtypes of Namespace can contain any other ModelElements, the MOF Model restricts the legal containments to eliminate various nonsensical and problematical cases.

    Table 7.4 shows the legal ModelElement containments in matrix form. The rows are the non-abstract subtypes of Namespace (i.e., possible containers) and the columns are the non-abstract subtypes of ModelElements (i.e., possible contained elements). For each combination of container and contained, a “Y? says that containment is legal and an “N? says that it is not.

   NOTE: The normative specification of the containments rules is in the OCL rules

    Table 7.4 summarizes the OCL containment rules..

   Table 7.4 - The ModelElement Containment Matrix

Package

Class

PrimitiveType

StructureType

CollectionType

Package Y Y Y Y Y
Class N Y Y Y Y
Primitive Type N N N N N
Structure Type N N N N N
Collection Type N N N N N
Enumeration Type N N N N N
Alias Type N N N N N
Structure Field N N N N N
Association N N N N N
Operation N N N N N
Exception N N N N N

   NOTE: While the MOF Model allows Classes to contain Classes, the MOF to IDL mapping does not support this. Any metamodel in which Classes are nested inside Classes must be considered as not technology neutral.

   © ISO/IEC 2005 - All rights reserved