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

Steve Alexander steve@cat-box.net
Sun, 27 Apr 2003 14:34:15 +0300


Shane Hathaway wrote:
> Steve Alexander wrote:
> 
>>
>>> I would say that the problem is that we can't get the path to 
>>> traverse to get to an object if we know only its oid.
> 
> 
> How does an object hub figure out the hubId of a wrapped object?

The objecthub gets the path of the wrapped object, by inspecting its 
context wrappers (zope.app.traversing.canonicalPath helps here). It then 
looks up the path in its path-->hubId OIBTree.

(Actually, I missed a step where it adds a '/' to all but the root path, 
but that's just part of the way the objecthub works internally.)

Each context wrapper around an object can have a dict associated with 
it. The dict is used to store "context metadata" about the object. The 
most usual form of this is that 'name' in the dict is mapped on to the 
string that is the name that was used to retrieve the object from its 
container. By examining all of these names, we can reconstruct the path 
to an object.

--
Steve Alexander