This chapter describes the Meta Data Services APIs that describe to MDS the data that
an application will store in the MDS repository. The data definitions are described
in Class, Property, and Relationship descriptions. The group of data definitions for
an application is called an AIM.
The AIM classes are:
CMetaAIM Class: Class to create and read AIM objects, and to create Class and Relationship Description
objects, linking them to the AIM.
CMetaClassDesc Class: Class to create property description objects, and link them to this class. Also
used to get associated properties, and access the collection of relationship descriptions
involving that class.
CMetaPropertyDesc Class: Class to read a class property description object.
CMetaRelationshipDesc Class: Class to read a relationship description object.
All AIM classes inherit the functions of the CMetaPersist and CMetaObject classes.
Changes that can be made to an AIM are:
Adding class, property and relationship descriptions
Enabling or disabling data versioning for the AIM
Deleting property descriptions
Deleting a class description (deletes all objects in the class as well as the class
description)
Deleting a relationship description (deletes all relationships of that type as well
as the relationship description)
Deleting an AIM (deletes all class, property and relationship descriptions in the
AIM)
Note: See the WriteObject function in each AIM class section for the list of properties
that can be updated.
MDS manages the creation of these classes within the repository. To create an AIM,
perform the following steps:
Instantiate a CMetaAIM object.
Call CMetaAIM.CreateModel() passing in the AIM name and description parameters to
create a new model object in the MDS repository.
Call CMetaAIM.CreateClassDesc() passing in the appropriate parameters to create a
class description.
Using the CMetaClassDesc object returned from CreateClassDesc, call CMetaClassDesc.CreatePropertyDesc()
to create each of the Property Descriptions associated with the class.
Repeat the last two steps for each class description being created in the Model.
Call CMetaAIM.CreateRelationshipDesc() to create each relationship in the model.
An application can retrieve these model-related objects in two ways, depending on
which identifying characteristics are known:
If only the name is known for Class, Relationship or Property objects, the application
must create a CMetaAIM object and read the AIM object from the repository. Then invoke
the appropriate CMetaAIM:Getxxx functions directly, passing in the object’s name.
Use the same process to get a named Property Description for a Class, after the CMetaClassDesc
object is obtained.
If the ObjectGUID or ObjectID is known, an application can instead:
Create the type of object desired using a constructor taking the ObjectGUID or ObjectID.
Invoke the ReadObject function within the newly built object.