4-2 SOMobjects Base Toolkit Programmer’s Reference
Manual
SOMMBeforeAfter Metaclass
Description
SOMMBeforeAfter is a metaclass that defines two methods (sommBeforeMethod and
sommAfterMethod), which are invoked 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.
Warning: The somDefaultInit and somFree methods are among the 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.
SOMMBeforeAfter is thread-safe.
File Stem
sombacls
New Methods
None.
Overriding Methods
somDefaultInit
somInitMIClass
Kommentare zu diesen Handbüchern