[Zope] Object reference and the _SetObject() method

Martijn Pieters mj@antraciet.nl
Tue, 19 Oct 1999 13:06:54 +0200


At 11:50 19/10/99 , Johan Carlsson wrote:
> > >    My questions!
> > >
> > >    Is this correct to do this or can I get my self
> > >    in trouble doing direct reference in this way?
> > You will eventually ;-) Especially if your objects are not Zope objects
> > that follow the Zope management interface.
>
>But what could happen, if I keep record of the references, where could
>it break? And yes I'm going the link only objects with Management Interface.

Nothing. Just because the Zope management interface uses a hierarchical 
structure, doesn't mean that every object cannot be referenced more then once.


>Here's what I whan to do:
>
>I want to create superclasses for bidirectional links between Zope
>objects. The link object has a object _link thats a object referense
>to the other object. The other objects has a list of links to it
>so when it's deleted it can notify the link object. Have been looking
>in ObjectManager if one can use the manage_beforedelete method
>to handle the delete through a tree.

manage_beforeDelete would be the way to handle this, yes. Just remember, 
that other classes might also define this method.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------