As described previously, the somDefaultInit method can be overridden to customize the initialization of objects. Because classes are objects, somDefaultInit is also invoked on classes when they are first created (generally by invoking the somNew method on a metaclass). For a class object, however, somDefaultInit normally just sets the name of the class to "unknown," after which the somInitMIClass method must be used for the major portion of class initialization. Of course, metaclasses can override somDefaultInit to initialize introduced class variables that require no arguments for their initialization.
Note: Because somNew does not call somInitMIClass, class objects returned from invocations of somNew on a metaclass are not yet useful class objects.
The somInitMIClass method (introduced by SOMClass) is invoked on a new class object using arguments to indicate the class name and the parent classes from which inheritance is desired (among other arguments). This invocation is made by whatever routine is used to initialize the class. (For SOM classes using the C or C++ implementation bindings, this is handled by the somBuildClass procedure, which is called by the implementation bindings automatically.) The somInitMIClass method is often overridden by a metaclass to influence initialization of new classes in some way. Typically, the overriding procedure begins by making parent method calls, and then performs additional actions thereafter.
However, without use of the Cooperative Metaclass to guarantee correct operation of SOMobjects in general, none of the methods introduced by SOMClass should be overridden. As a result, customizing the initialization of class objects (other than through overriding somDefaultInit for initialization of class variables) is not recommended in SOMobjects 2.1. Users whose applications require this should request access to the experimental Cooperative Metaclass used to implement the SOMobjects Metaclass Framework. But, metaclasses implemented using the experimental Cooperative Metaclass may require reprogramming when SOMobjects introduces an officially supported Cooperative Metaclass.