[Zope-dev] make zope.component.registry.Components inherit from dict?
optilude+lists at gmail.com
Tue Nov 24 21:53:03 EST 2009
Chris McDonough wrote:
> I fear it was for naught, sorry.
> Adding an attribute is unsightly and turning this into a component problem
> doesn't have enough immediate gain. The BFG registry will just continue to be
> a dict subclass.
> If Zope folks later want to use libraries that come from BFG-land (particularly
> libraries that have ZCML directives), they'll just need to deal with code that
> wants to use the dict API against the component registry.
If you're going down this route, my suggestion would be to not (ab)use
the ZCA site manager object for this at all. I'd have it be something
separate you access via a getConfigRegistry() or whatever. Threadlocals
are easy enough to set up.
If we're not doing any consistency with the ZCA notion of a utility,
then it seems wrong to conflate the two. ZCA utilities are still usable
(and used?) in BFG.
If that is in a separate package (repoze.configregistry or whatever),
it's re-usable in Zope as well. Everyone wins. :)
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
More information about the Zope-Dev