[Zope3-dev] Re: calling interface returns object, calling queryAdapter returns None?

Marius Gedminas mgedmin at b4net.lt
Thu Jan 25 06:09:34 EST 2007


On Wed, Jan 24, 2007 at 08:44:31PM -0500, Tres Seaver wrote:
> Note that for regularity, I assert that the calling the IFoo interface
> should allow the follwing use cases, based on the asserition that
> utilities are "zero-order" adapters, just as views are "binary order"
> adapters.

There is a very important difference.

When you do adaptation, an adapter factory gets called and you get a new
object.  (There are exceptions -- the adapter factory may do caching, or
the object you're adapting may already implement the interface.)

When you do utility lookups, you always get the same object.  No factory
ever gets invoked.

Marius Gedminas
-- 
Special bonus feature: absolutely nowhere in RetchMail's code is there an
arbitrary 3-second sleep(). Wow! What other mail retriever can say that? (Hint:
not fetchmail.)
	-- http://open.nit.ca/wiki/index.php?page=RetchMail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20070125/255c0f8b/attachment.bin


More information about the Zope3-dev mailing list