Previous | Table of Contents | Next |
One of the advantages of meta-objects (in the general sense) is that they allow a program to use objects without prior knowledge
of the objects’ interfaces. In the MOF context, an object's M2-level meta-object allows a program to “discover? the nature
of any M1-level MOF object, both at a syntactic level and at a deeper level. With this information in hand, the MOF’s Reflective
interfaces allow a program to:
• create, update, access, navigate and invoke operations on M1-level Instance objects,
• query and update links using M1-level Association objects, and
• navigate an M1-level Package structure
without using meta-model specific interfaces.
NOTE: The functionality above is all available through the “model specific? interfaces defined by the IDL mapping described
in this clause. The Reflective interfaces do not allow a program to access or update MOF objects contrary to their meta-object
descriptions. For example, they cannot be used to create, access or update Attributes that do not exist, or to bypass Constraint
checking.
In addition, the Reflective interfaces allow the program to:
• find a M1-level object’s M2-level meta-object,
• find a MOF object’s container(s) and enclosing Package(s),
• test for MOF object identity, and
• delete a MOF object.
NOTE: While many of these capabilities are correctly described as reflective, the MOF does not offer the full repertoire of
reflective programming features. Since it does not define object behavior, the MOF does not define interfaces for reflective
behavior modification. Even if it did, these interfaces could not be implemented in many CORBA contexts.
The CORBA Interface Repository (IR) and the Dynamic Invocation Interface (DII), provide similar capabilities in the context
of a CORBA object's Interface. However, using the IR and DII for this purpose means that the user cannot make use of the richer
semantic information in models defined using the MOF meta-model. For example, the IR can tell the user that the “Model::Contains?
IDL interface has an operation called “exists;? however, it is only by using MOF metaobjects that the user knows that the
“exists? operation tests whether one object “contains? another one.
The MOF Reflective module contains four “abstract? interfaces that are inherited by the M1-level interfaces for a model that
are generated from a meta-model by the IDL mapping.
1. The Reflective::RefObject interface provides common operations for M1-level Instance objects and Class Proxy objects.
2. The Reflective::RefAssociation interface provides common operations for M1-level Association objects.
3. The Reflective::RefPackage interface provides a common operations for M1-level Package objects.
4. The Reflective::RefBaseObject interface provides common operations for all MOF objects.
Since the M2-level interfaces for the MOF Model are generated by this means, they also inherit from the Reflective interfaces.