Proposal: discussion of use of separate proxies versus amending classes
A postscript version of this whole document is available
The latex source is available here
At the EUROPA meeting of 19/20 July 1995 it was agreed that a model
based on generation of external proxies was the best model. Using
this model a scanner walks over the header files of classes and
generates proxies for the classes that can deal with forwarding
messages to remote objects.
The UC++ model of proxies is that the users classes are actually
changed by the insertion of data members (in fact a supertypes) and by
the insertion of a hook at the beginning of each member function.
This means that the proxy and the actual object are distinguished just
by a boolean value: all member functions have a test on this value.
The advantages of the externally generated proxy method are as
- the users code is unaffected---there is no `invasive'
preprocessing. All that is generated is a set of extra classes,
that are used like library classes. For profiling and debugging
purposes it is clear what is the users code and what the generated
- efficiency: the UC++ model introduces a test on every member
function, whether on a passive or an active object. With the proxy
model the appropriate type (be it passive, a proxy or the real
object) can be allocated and not have to use the tests.
- extensibility---the generated proxies can be used by the
programmer as fully fledged types and use them to define new
behaviour. With the UC++ model the behaviour is encapsulated in the
redirector functions at the head of the members.
There are however certain problems with the proxy generator model:
- since the proxy and the realobject are not the same type, but
rather the proxy is (presumably) of a type derived from the real
type, static binding of member functions will not work correctly,
unless all member function are declared virtual by the user in the
class to be made active.
- The performance penalty of a virtual member function call is
probably larger than that of the single test.
Wed Aug 2 17:54:54 BST 1995