[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

Chapter 10. Programming with MetaClass Objects

In SOM, a class defines the implementation of objects. An object is an instance of a class or an instantiation of the class. In SOM run time, classes are themselves objects that have their own methods and interfaces and are themselves defined by other classes. These other classes are referred to as metaclasses. An instance of a metaclass is a class object and an instance of a class is an object. Construction and deletion of an object (creating and deleting an instance of a class) is performed by method calls on the class object. (The C macro ClassNameNew and the C++ new operator result in calls to the somNew method of the class object.)

Primitive classes that are the basis for all other classes include:

SOMObject Root ancestor class for all SOM classes.
SOMClass Root ancestor class for all SOM metaclasses.
SOMClassMgr Class of the SOMClassMgrObject. This object is created automatically during SOM initialization. It maintains a registry of existing classes and assists in dynamic load and unloading of classes.

SOM permits derivative implementations of these classes that can override or extend the class method or variable set. Ultimedia Services contains the classes:

UMSObject Child of SOMObject and ancestor of all Ultimedia Services classes. It overrides the somInit method of SOMObject.
UMSClass Child of SOMClass and ancestor of all Ultimedia Services metaclasses. It overrides the somNew method of SOMClass.

Additionally, several Ultimedia Services classes have unique metaclasses that provide unique object construction methods. For example, UMSAudioFileMClass is the metaclass of UMSAudioFile and provides the additional construction methods of make_by_filename and make_by_alias.

To learn more about programming with metaclass objects, see:

For a more thorough discussion of these relationships, see the AIX Version 4 SOMobjects Base Toolkit User's Guide.

[ Previous | Next | Contents | Glossary | Home | Search ]