Programming Reference: Overriding Inherited SOM Methods

# Programming Reference

## Overriding Inherited SOM Methods

The following methods are inherited and are available for use when you subclass specific classes.

### somInit

This method initializes the instance variables in a SOM object. somInit is inherited from the SOMObject class.

If you subclass the specific class, you can override the somInit method. Your override method does not need to call its inherited method, the inherited method is called by the SOM library.

Your override of this method must initialize the new instance variables in this object. The SOM library calls somInit when this object is created. Do not do anything that could cause this method to fail, to prevent failure:

- Set all pointer variables to null.
- Set numeric variables and constants to appropriate values.

If you have any initialization code that could potentially fail, handle this object's subclass-specific initialization method through the class-dependent initialization method.

The initialization method, dependent on the class, is:

- ODDispatchModule::InitDispatchModule
- ODEmbeddedFramesIterator::InitEmbeddedFramesIterator
- ODExtension::InitExtension
- ODFocusModule::InitFocusModule
- ODFocusOwnerIterator::InitFocusOwnerIterator
- ODPart::InitPart or ODPart::InitPartFromStorage
- ODTransform::InitTransform

### somUninit

The somUninit method disposes of the storage created for a SOM object. This method is inherited from the SOMObject class.

If you subclass the specific class, you can override somUninit. Your override method does not need to be an inherited method, the inherited method is called by the SOM library.

Your override for this method should dispose of any storage created for the object, including any storage related to additional instance variables initialized for the object. The SOM library calls this method when the object, part, iterator or module is deleted. This method must not fail.

[ Top | Previous | Next | Contents | Index | Documentation Homepage ]