[Zope-CMF] Re: getToolByName depreciation, getUtility, and five.lsm

Philipp von Weitershausen philipp at weitershausen.de
Thu Mar 29 14:54:08 EDT 2007


Tres Seaver wrote:
> I'm not sure what impact that would have for the already-converted code
> which used to use the API.  I can see value both in leaving it
> converted, as showing the Zope3-ish way, as well as in reverting some or
> all of it.  For instance, perhaps we should consider reverting just
> those changes which look up acquisition-dependent tools, since the call
> site has now become required to manage the wrapper itself.

I would only be comfortable doing that if we had unit tests for those 
tools that aren't acquisition-dependent. And by unit test, I mean real 
unit tests and not a ZopeTestCase. That's the only way we can really be 
sure that that a tool can function as a utility, an independent 
component, w/o acquisition.

Not knowing the codebase, I suspect that this isn't the case and suggest 
using getToolByName for all right now and adding such tests to the TODO 
list for the next CMF release.


-- 
http://worldcookery.com -- Professional Zope documentation and training



More information about the Zope-CMF mailing list