Message Filters for Object-Oriented Systems

In the conventionalobject model, encapsulatedobjects interact by messages that result in method invocations on the destination object. A message is delivered directly at the destination object. As a result of the direct deliveries, the message control code performing intermediate message manipulations cannot be abstracted out separately from the message processing code in the destination object without sacrificing the transparencyof the intermediate message control. We propose the filtered delivery model of message passing for object-oriented languages to provide the separation of message control from message processing in a transparentmanner. An interclass relationship, called a filter relationship, is introduced. As a consequence,a filter object can intercept and manipulate messages sent to another object called its client via filter member functions. A filter member function in a filter object can intercept a particular member function invocation on its client object. The filtered delivery model supports both upward and downward filtering mechanisms, facilitating interception of an upward message and its return message value. Filter objects can be plugged or unplugged at runtime. Binding of filter member functions to corresponding member functions in the client is selective and dynamic. The filtered delivery model is developed for the C++ object-oriented language; its applications are described and implementation is discussed. 1997 by John Wiley & Sons, Ltd.