Jump to content

SOMMBeforeAfter

From EDM2
File stem
sombacls
Description

SOMMBeforeAfteris a metaclass that defines two methods (sommBeforeMethod and sommAfterMethod) which are invoke before and after each invocation of every instance method. SOMMBeforeAfter is designed to be subclassed. Within the subclass, each of the two methods should be overridden with a method procedure appropriate to the particular application. The before and after methods are invoked on instances (ordinary objects) of a class whose metaclass is the subclass (or child) of SOMMBeforeAfter, whenever any method (inherited or introduced) of the class is invoked.

Caution: The somDefaultInit and somFree methods are among th methods that get before/after behavior. This implies that the following two obligations are imposed on the programmer of a SOMMBeforeAfter class. First, your implementation must guard against calling the sommBeforeMethod before somDefaultInit has executed, when the object is not yet fully initialized. Second, the implementation must guard against calling sommAfterMethod after somFree at which time the object no longer exists.

New methods
None
Methods
Overridden methods