[Zope-dev] Re: unregistering components?

Philipp von Weitershausen philipp at weitershausen.de
Sun Nov 25 08:27:40 EST 2007


On 25 Nov 2007, at 13:37 , Chris Withers wrote:
> Philipp von Weitershausen wrote:
>>>> class IComponentRegistry(interface.Interface):
>> I think you should use zope.component.getGlobalSiteManager() for  
>> this.
>
> So getGlobalSiteManager returns a component registry?

Yes. It returns the one and only global registry.

> If so, how come it's not called getGlobalComponentRegistry?

Because component registries used to be called site managers and we  
can't just change the API at this point anymore.

> How do you set up nested registries? For example, if a certain area  
> of a site should have a registry which overrides the global one, but  
> only for that area, and should fall back on it if not adapter could  
> be found?

You use sites. Sites are places (usually containers) in the component  
hierarchy that have (local) component registries associated with them.  
And yes, the name "site" is misleading, but again, we have it as  
legacy now. How to work with sites, how to set them up, etc. is all  
explained in my book. I'm sure you have a copy :)

(Btw, this thread has nothing to do with the development *of* Zope and  
is therefore zope at zope.org or zope3-users at zope.org rather than zope-dev at zope.org 
  material.)


More information about the Zope-Dev mailing list