Re: make zope.component.registry.Components inherit from dict?

Martin Aspeli <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Martin Aspeli wrote:

> I *do* actually like the "named IAnonymousUtility" thing as a 
> convenience, because it retains some consistency. Maybe it's slower, 
> which would be a negative. But it also allows all the other ZCA stuff 
> (overriding, introspection, global/local variants, etc) and API: we're 
> just introducing a convenience.

Oh, and here's another reason: this allows registration at ZCML 
configuration time rather than import time (since we're not setting it 
up in Python) without inventing new directives:

   <utilty
     name="root"
     object=".roots.myRoot"
     provides="zope.component.IAnonymousUtility"
     />

Or in Grok speak:

     grok.global_utility(myRoot, IAnonymousUtility, name="root")

I think we'd want a less icky name than IAnonymousUtility, though.

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book

_______________________________________________
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.