[Zope-dev] Multi-homed objects?

Shane Hathaway shane@digicool.com
Mon, 17 Jul 2000 09:24:37 -0400


Chris Withers wrote:
> 
> Shane Hathaway wrote:
> > This could be part of a "visitor" interface I've been pondering in the
> > back of my mind.  It would be capable of traversing, performing an
> > arbitrary function, and never falling into a recursive trap.
> 
> Cool :-)
> 
> Let me know when it's available :-)
> 
> Can you see any weirdities that might occur from having an object as an
> attribute of more than one object manager / folder?

The recursion problem, for one.  Also, if you change the object in one
place, it will also get changed in the other, which may not be the
expected behavior.

You could also do soft links like this (I bet this actually works :-)
):

class SoftLink (SimpleItem):
  def __init__(self, path):
    self.path = path

  def __of__(self, parent):
    ob = self.restrictedTraverse(self.path)
    return getattr(ob, 'aq_base', ob).__of__(parent)

... but once again, changes made in one place would cause changes in
the other.  And then there are security considerations: how should the
security behave if two users with different roles want to access/change
the object?

> PS: Do you know the answer to my &dtml.url-; question I asked earlier?

I couldn't find your question.  :-(

Shane