[Zope-CMF] tools, utilities, and getToolByName

Martin Aspeli optilude at gmx.net
Thu Apr 19 10:52:45 EDT 2007




Kapil Thangavelu wrote:
> 
> if by consensus you mean vote..
> 
> +1 on undepreciating gettoolbyname
> 

This is one of those rare cases where I've changed my mind having been
swayed by the arguments of Alec and others.

 +1 to un-deprecating getToolByName()

 -1 to relying on five.localsitemanager, especially if it means other site
managers somewhere inside the CMF site will need to be five.lsm aware.

 +1 to only register as utilities those tools which are truly contextless.

 +0.5 to letting getToolByName look up these truly contextless tools as
utilities and return them wrapped

Also: +1 to keeping the site root registered as a utility providing
ISiteRoot, even though it won't be aq wrapped on return by default.

I think going forward, we need to identify which tools we can safely turn
into proper global/local utilities, i.e. those which do not require aq
wrapping. I don't think the lack of security context for these is a problem,
because you should be using Z3 views to look them up anyway, i.e. we don't
need something like getToolByInterfaceName really. In some cases, we may be
able to deprecate some tools or some methods from some tools by giving the
equivalent functionality in a view (these being the ones that need a context
and/or request passed in).

Martin
-- 
View this message in context: http://www.nabble.com/tools%2C-utilities%2C-and-getToolByName-tf3606802.html#a10078654
Sent from the Zope - CMF list2 mailing list archive at Nabble.com.



More information about the Zope-CMF mailing list