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

Steve Alexander steve@cat-box.net
Wed, 23 Apr 2003 17:44:37 +0200


Jeremy Hylton wrote:
>>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.

I think he meant "lightweight" or "location independent" references.


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

In Zope, often you want to get to an object in context, so you can take 
into account local security restrictions and local service overrides.

You can't easily store an object in context in the ZODB, so usually we 
store paths to the object instead.

Storing paths is a pain because they are unicode strings, and so are 
moderately big, and because when you move an object its path changes.

The ObjectHub manages a path<->integer_id mapping, so you can use an 
integer id instead of a path, and ask the objecthub to dereference it to 
an object in context.

HubIds are non-zero integers, managed by the ObjectHub. They are 
non-zero so you can use the idiom:

   if hubId:
       do stuff

--
Steve Alexander