Re: Stacking zope.component registries

Martin Aspeli <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Stephan Richter wrote:
> On Thursday 08 April 2010, Martin Aspeli wrote:
>> Can you elaborate on what you mean here?
>
> So I think this can all be done independently of base registry (unless you are
> are planning to store the registry in the ZODB).
>
> The key for layering is the ability to inherit components using the __bases__
> attribute (see registry.py). So something like:
>
> reg1 = Components('reg1') # Registry for layer 1
>
> Then for the next layer that is based on layer 1, you can do:
>
> reg2 = Components('reg2', (reg1,)) # Registry for layer 2
>
> This should behave identically to how ZODB storage layering works.

Right. However, any calls to provideAdapter() and friends would still 
use the global registry, unless I monkey patch 
zope.component.globalregistry.base, as would any ZCML directives, I guess.

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.