[Zope-CMF] Re: [dev] unresolved site manager related issues

yuppie y.2007- at wcm-solutions.de
Thu Apr 12 06:16:23 EDT 2007


Hi!


Philipp von Weitershausen wrote:
> yuppie wrote:
> Kapil's also right when he says that utilities by 
> principle are context-less components.

By principle all Zope 3 code might depend on setSite to work as 
expected. We just don't pass that 'site context' explicitly to the 
component as in Zope 2.

>> I still don't buy that context argument. Utilities and tools both are 
>> used in the 'context' of a site.
> 
> You just gave the definition of a tool, not the one of a utility.

By 'site context' I don't mean an Zope 2 acquisition context or an 
adapter context. I mean the site specific local environment that is 
usually looked up based on setSite or provided by CMF tools.

>> The only difference is how the knowledge about the site is used: Just 
>> for lookups or also for acquisition wrapping.
> 
> If a tool needs to get to the site object in order to operate, it might 
> not be such a good idea to convert it to a utility. It might make more 
> sense as an adapter... What I'm saying is that the "all tools are 
> utilities now" assumption might've been a bit too naive.

Of course CMF tool interfaces have some methods we would not add to a 
new utility interface. But most of them would become views, and as long 
as we pass in the REQUEST explicitly they are still valid utility methods.

I'm not aware of any tool methods that should be converted to site 
adapters. Most tools use the 'site context' just for the security 
machinery. The other reason why tools needed the context was looking up 
other tools, but that is obsolete in CMF 2.1 beta. I consider every 
other usage of the acquisition context a bug.


Cheers,

	Yuppie




More information about the Zope-CMF mailing list