[Zope] Object reference and the _SetObject() method

Michael Bernstein mbernstein@profitscape.net
Wed, 20 Oct 1999 17:05:03 -0700


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.
>
> 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.

This would be great! Some thoughts:

- It would be really nice if ZClasses could have 'link' properties instead of
objects. (ie: in propertysheets)
- How about 'link-list' properties?
- What if you could access the linked-to object's properties?
- It would be nice if you could get ZCatalog to index on 'link' properties or
objects
- It would be nice if ZCatalog could index on the linked-to objects' properties
- Maybe these should be called 'pointers' instead of 'links'

Thoughts?

Michael Bernstein.