[Zope-CMF] Implicit and Acquirer
Dieter Maurer
dieter at handshake.de
Sat Mar 11 13:48:39 EST 2006
George Lee wrote at 2006-3-11 00:41 -0500:
> ...
>What is the difference between Implicit and Acquirer? Between Explicit
>and Acquirer?
An acquirer is an object with two components "aq_self" and "aq_parent".
If asked for an attribute, any acquirer passes the request on
to "aq_self" and returns the result if "aq_self" can deliver
the attribute.
The difference between an ImplicitAcquirer and an ExplicitAcquirer
comes only into play when "aq_self" cannot deliver the asked
for attribute. In this case, an ImplicitAcquirer automatically
passed the request on "aq_parent" while an ExplicitAcquirer fails
(with an AttributeError).
>Including, what methods do Implicit and Explicit *add* or *override*?
Both have the same methods (and attribute).
>For instance, does Explicit add an aq_acquire method?
No. But "aq_acquire" is more important for an "ExplicitAcquirer"
than for an "ImplicitAcquirer":
"aq_acquire" supports precise control over the lookup
behaviour of all kinds of acquirers.
With an "ExplicitAcquirer", you (usually) must use "aq_acquire"
to look the attribute up in "aq_parent"; an "ImplicitAcquirer"
would do this automatically (if necessary).
>What else?
Nothing.
>I tried sifting through the C code and the epydoc files but still
>couldn't make sense of it all -- it seems that Implicit and Acquirer
>are really the same, for instance. Answers or references would be very
>appreciated, thanks.
Apparently, you have a reason to use the strange "Implicit and Acquirer"...
In fact, there are two kinds of "Acquirers": "ImplicitAcquirer"
and "ExplicitAcquirer". There is nothing like "Implicit and Acquirer".
--
Dieter
More information about the Zope-CMF
mailing list