whit wrote:
I remember some discussion of this in the past.

Transitionally, it would be helpful to be able to register local utilities to a tool name, and then have getToolByName spit out a deprecation warning and return an appropriate object.

Why a deprecation warning and not just do it?

IIRC the whole point of 'getToolByName' was from the very
onset (years ago) to be forward compatible in terms of Zope 3.

Relying on Z2's implicit acquisition, it would so far always
be possible to just write

    tool = [context|self].<tool-id>

and it would just work. Recommending to people to write

    from Products.CMFCore.utils import getToolByName
    tool = getToolByName([context|self], <tool-id>)

was justified by the perspective that Zope 3 doesn't support
implicit acquisition any longer *and* that the way how tools
(now utilities) might get looked up in context may change.

It was the promise that 'getToolByName' would always just do
the right thing (TM) so that add-on developers would not have
to worry. So why deprecating that now?

Am I missing something?

Raphael


thoughts? comments? does this exist somewhere already?

-w

_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to