[Zope3-dev] zwiki: performance of findChildren()

Roché Compaan roche@upfrontsystems.co.za
Fri, 25 Apr 2003 09:23:53 +0200


On 24 Apr 2003 14:08:23 -0400
Jeremy Hylton <jeremy@zope.com> wrote:

> On Wed, 2003-04-23 at 02:37, Roché Compaan wrote:
> > I'd love to know what the caveats you ran into were. We built a
> > relationship manager around mxmRelations and so far it has given us a
> > lot of joy. It is still early though and maybe the problems you ran into
> > can help us steer around them.
> > 
> > Briefly, this is how we put it together:
> > 
> > For each class we define an _relations structure similar to _properties
> > used by the PropertyManager that is a list of mappings specifying the id
> > and cardinality of the relationship:
> > 
> >     class Person(<zope classes>, RelationsAware):
> >         _relations = (
> >             {'id': 'Organisation', 'cardinality': 'single'}
> >             {'id': 'Address', 'cardinality': 'multiple'}
> >         )
> > 
> 
> What is an mxmRelation?

It is a BTree storing bi-directional relations between objects (from
Max's mxmRelations Product).

> I was thinking that some kind of property could
> be used to provide indexex relations in ZODB, where client code could
> treat the relation just like any other attribute.  Is that the basic
> idea of what you're doing?

Precisely!

> I'm not clear on how this would get integrated with the ObjectHub, but
> it seems pretty useful for ZODB applications in general.

Absolutely. It would make life a lot easier.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za