[Zope-dev] summary of discussion was: adapter vs factory Re: implementing zope.component 4.0

Lennart Regebro regebro at gmail.com
Tue Dec 1 11:25:58 EST 2009


On Tue, Dec 1, 2009 at 16:28, Martijn Faassen <faassen at startifact.com> wrote:
> * abstract factory not called on an object ("utility factory",
> "null-adaptation")
>
>    In: the requested interface
>
>    Process: look up factory. Call factory.
>
>    Out: a new instance that provides the requested interface

When would you need this? As I understand it, the only difference from
the normal utility lookup is that you don't get singletons. IMO that
breaks the concept of what a utility is, so null-adaption is a better
name for that, but that still means you adapt nothing, so it's not an
adapter either. :-)

> * abstract instance retrieval for an object ("utility associated with an
> instance", "adapting to an existing instance")
>
>    In: the requested interface, one or more instances.
>
>    Process: look up instance with input instances as "context".
>
>    Out: a previously registered instance that provides
> the requested interface

Hmm. Singleton adapters, in other words. I can see that as useful, sure.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64


More information about the Zope-Dev mailing list