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

Jeremy Hylton jeremy@zope.com
22 Apr 2003 16:31:26 -0400


> Doing weak references between business objects in the system is my 
> el-numero-uno wanted feature.  

Why do you want weak references in particular?  I don't understand what
purpose weak references serve in ZODB.  In regular Python, a weak
reference allows the memory for an object to be freed while someone is
holding weak references to it.  In ZODB, the process memory is managed
by the object cache, which some limit or possibly eliminate the need for
a weak reference.  The storage space isn't going to get freed by a weak
reference anyway, because pack doesn't work that way.

> What I'd ultimately like is something 
> like the following::
> 
>    People
>     |
>     +--Bob
> 
>    Receipts
>     |
>     +--Receipt1
>     |
>     +--Receipt2
> 
> 
>   in: Receipt1.purchaser = People.Bob
>       # maybe some sort of weakref(People.Bob)?
>   in: Receipt2.purchaser = People.Bob
>   in: Receipt2.purchaser.name
>   out:  'Bob'
>   in: Reciept2.purchaser.name = "Robert"
>   in: Receipt1.purchaser.name
>   out:  'Robert'
> 
> IE - How can we do one-to-many, many-to-one, many-to-many, and 
> one-to-one (non-containment) relationships in the ZODB that is 
> relatively natural?  Why wouldn't an ObjectHub fill these scenarios?
> 
> I want to wean myself off of SQL as soon as possible, but optimized 
> Querying and Relationships are still a tough point in Zope/ZODB.

Why don't collections -- persistent dict and lists and BTrees -- fulfill
this need?

Jeremy