Re: improving the utility and adapter lookup APIs

Thomas Lotze <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Gary Poster wrote:

> 
> On Nov 25, 2009, at 11:17 AM, Thomas Lotze wrote:
> 
>> What about a simple and consistent API for all components including
>> utilities, adapters and multiadapters:
>> 
>> IFoo()
>> IFoo(x)
>> IFoo(x, y)
>> 
>> I seem to remember there had been some discussion at some point about
>> dropping or at least loosening the distinction between utilities and
>> adapters anyway, so this would be the opportunity to do so at the API
>> level.
> 
> That was discussed and rejected near the very beginning of the Z3
> effort, in my memory.

OK. If that was a hard and fast decision, I'll not argue further.

> They are too different.  Our use of adapters
> generally involves looking something up and automatically calling it. 
> Our use of utilities generally involves simply looking something up and
> returning it.

I do think, however, that this is more a problem with registration than
with look-up. You need to know whether to register a factory or an
instance of a component, but whatever you look up will provide the
interface you require and doesn't have to be called in either case.

-- 
Thomas



_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.