[Zope-dev] Pointer or reference object

Johan Carlsson johanc@torped.se
Tue, 7 Mar 2000 00:50:48 +0100


Jason, Ty, Itamar, and others,

> Ty:
> It looks like recent Zope releases do pass beforeDelete all the way
> down.

Oh, that's good news :-)
Just the acquisition part to worry about then...
 
> Pointer is sort of like the ZMirror mentioned, but I really don't think
> it's what you want. It was more of an expirement than somthing intended
> to be useful (it requires a change to Zope to install, for example).

No, it's not that I what. But it's a prototype useful for learning from.

> Jason:
> Actually I'd was more thinking along the lines of the referenced object
> acting just like the object that it's linked to.  Meta-type too.

Me too.
A reference to a folder would act similar to the pointer product thou.


> <dtml-in "objectValues(['MyApples'])"> will get you the references to any
> apples in that folder too.  It allows you to have an object in two
> places(being a physical distinction which matters in Zope) without
> duplicating the filespace and work to create a second object.

I don't quite get that? Sorry.

> Itamar:
> How about a product with only two methods in the module - manage_addMirror
> and manage_addMirrorForm.  the form lets you choose an object somehow (by
> URL?) and manage_addMirror simply adds this object?  Something like:

I really like a object browser, like a file browser (explorer, finder, ...) in a 
regular OS. Not only for this Mirror-Reference Product but general.

 
> def manage_addMirror(self, url, REQUEST=None):
>     """Add a Mirror
>     """
>     ob=REQUEST.resolve_url(url)
>     id=self._setObject(id, ob)
>     if REQUEST is not None:
>         try: u=self.DestinationURL()
>         except: u=REQUEST['URL1']
>         REQUEST.RESPONSE.redirect(u+'/manage_main')
>     return ''

What happens to the acquisition of this object?
What happens if the object that this object point at 
gets deleted or moved? (Moved shouldn't be a problem?)

I feel strongly for a reference count or a bi-directional
reference to solve the problem with reference integrity.
But that would probably need a base class for referable 
objects to derive from.

//Johan