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

Jeremy Hylton jeremy@zope.com
25 Apr 2003 14:58:34 -0400


On Fri, 2003-04-25 at 14:51, Roch=E9 Compaan wrote:
> I think the cardinality of the relationship is important too. If it is
> a many to many relationship like the above then one would know that
> zope3.developers and stevea.projects would both return sequences. But i=
f
> I register the relationship between SoftwareProject and Developer as a
> many to one relationship:
>=20
>     rel =3D relation(SoftwareProject, Developer, OneToMany)
>=20
> then the following will hold true:
>=20
>     assert zope3.developer.Name =3D=3D 'Steve Alexander'
>=20
> as well as:
>=20
>     assert zope3 in steva.projects

Good point!  There aren't too many choices for cardinality, right?  So
we could have separate constructors for each possibility.

rel =3D one2many(SoftwareProject, Developer)

I realized that the example I posted doesn't quite make sense.  That is,
it doesn't use properties, and I'm not sure how a single relation object
could offer the semantics I wanted.  That suggests that the relation
would need to be declared in the class, but there's a problem with
circular definitions that would need to get solved.

Jeremy