Alec Mitchell wrote:
On 4/15/07, Martin Aspeli <[EMAIL PROTECTED]> wrote:
Dieter Maurer wrote:
Alec Mitchell wrote at 2007-4-12 06:59 -0700:
... deprecation of "getToolByName" ...
which is that there's no practical reason other than
aesthetics to deprecate getToolByName at this point.
A very good point: let's deprecate deprecations done just for
aethetical reasons :-)
Aesthetics were not the original reason for moving down this route, so
it's a little unfair to cast it in that light. The main drivers, as I
recall, were to encourage API usage that would allow us to move tools
out of content space eventually, and to make code depending on CMF tools
more consistent with "newer" code which may depend on new utilities (at
least in the Plone world, there is a general consensus that we'd rather
not have any more content-space tools from now on).

What is it about getToolByName that implies that tools are in content
space?  Consistency with "newer" code is an aesthetic concern as far
as I understand it.

I suppose it depends on how you look at it. If we agree that the way to get tools out of content space is to make them utilities, and we want to be able to promise the normal semantics for global and local utilities. In that case, moving to getUtility as the API and interfaces as keys seems to be a long term goal. As for consistency, call it aesthetics, but I know it's becoming quite hard to explain to new developers that various things are semantically similar, but there is an old way that applies to cases X, Y and Z, and then a new way that applies to all other cases.

Anyway, the point here is the consistency/flexibility/ease of migration in the future benefit vs. the cost of time/complexity and indeed whether it's possible to achieve all the benefits with the current tool implementations.

This was all nice and pretty when no-one had thought that tools-as-utilities needed to be wrapped at all. If that'd been the case, we'd just be having a deprecation warning discussion. :)


Zope-CMF maillist  -

See for bug reports and feature requests

Reply via email to