[Zope] aq_acquire?

Phillip J. Eby pje@telecommunity.com
Mon, 25 Oct 1999 19:07:19 -0500


At 11:35 AM 10/25/99 -0400, Michel Pelletier wrote:
>
>The Acquisition module is written in C
>(lib/Components/ExtensionClass/Acquisition.c).  As far as I know, Jim
>and Guido are the only two people on the planet who can even grok it (I
>certainly can't)...
>

In the words of Yoda, "There is another..."  ;)

Acquisition really isn't that hard to grasp, with a good visualization.
The thing to remember is that once an object has been retrieved from
another, you don't really have that object, you have a binary tree of
wrappers connecting the object to its acquisition context.  The binary tree
is actually an ordered namespace stack.  Anything you retrieve from the
tree, will be bound as a new tree, one branch of which points to the
previous tree, and the other pointing to what you retrieved.  Of course,
what you retrieved is itself a similar tree, repeatedly nesting back to the
origin of the object on the one side, and the 'object itself' on the other.

Hmmm.  That would be much easier to explain with a whiteboard.  Ah well.
The tricky bit is when you start working with really deep acquistion
hierarchies, because the trees begin to become fractal, that is,
self-similar.  (This is why there's lots of code in Acquisition.c to avoid
needlessly re-searching common subtrees which have already been searched.)

I suppose this all just goes to underscore the fact that Acquisition.c is a
pretty heavy mojo.  So never mind.  :)