[Zope-CMF] Re: Small CMFCatalogAware refactoring
Sidnei da Silva
sidnei at enfoldsystems.com
Mon Sep 12 09:16:10 EDT 2005
On Mon, Sep 12, 2005 at 09:10:02AM -0400, Tres Seaver wrote:
| -----BEGIN PGP SIGNED MESSAGE-----
| Hash: SHA1
|
| Jean-Marc Orliaguet wrote:
|
| > then there is a list of hooks that can be migrated to the new
| > getToolByName() when it materializes. At least this shows the need for
| > named utilities in CMF.
|
| 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)
|
| rather than::
|
| catalog = getUtility(IGenericTool, 'portal_catalog')
|
| which will permit us to do component-style indirections based on the
| type of 'some_context'.
And then I think the component architecture supports named adapters
no? Maybe I'm just dreaming *wink*.
--
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com
More information about the Zope-CMF
mailing list