[Zope] Mythical Symlinks

Dieter Maurer dieter@handshake.de
Sat, 2 Mar 2002 15:45:39 +0100


Phil Harris writes:
 > I'm using the Symlink doohickey that Shane Hathaway did.
 > 
 > http://www.zope.org/Members/hathawsh/Symlink
 > 
 > All is well so far, but I find myself needing to add properties to the
 > symlink itself, without impacting on the original object.
 > 
 > Thing is that the symlink does it's job so well that the symlink is
 > indistinguishable from the original object and when getting properties etc.
 > it gets the properties of the original, hmmm, bugger (c).
 > 
 > Anyone have any idea what I'm talking about ;), and if so anyone have any
 > ideas?
I understand roughly what you are talking about.

But it is quite difficult to define precisely what semantics this
symlink with additional properties should have: e.g. when you
change something, should the modification apply to the symlinked object
or the proxy.

When you know precisely what you need, some form of proxy object
could be implemented. It does itself what is targeted to itself
and delegate everything else to the symlinked object (similar to
Python's "__getattr__" when used for delegation).


Dieter