On Mon, Sep 12, 2005 at 09:10:02AM -0400, Tres Seaver wrote:
| Those won't be named utilities;  they will be adapters, with
| "tool-centric" interfaces.  For code which currently spells the lookup::
| 
|   catalog = getToolByName(some_context, 'portal_catalog')
| 
| I prefer::
| 
|   catalog = ICatalog(some_context)

Which, in a backwards-compatible way could be implemented as:

def getToolByName(context, name):
   iface = lookupToolInterface(name)
   return iface(context)

And probably issuing a deprecation warning, though I'm not sure it's
really worth deprecating that.

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
_______________________________________________
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