[Zope-CMF] Re: Small CMFCatalogAware refactoring

Tres Seaver tseaver at palladion.com
Mon Sep 12 09:10:02 EDT 2005


-----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'.


Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDJX4q+gerLs4ltQ4RApuqAJ49ZuK8OXBvuQF4iW1rbmd1W63uBgCg0KmZ
6OnpptsEbXcJ0sIy5jHBOR4=
=CV4Q
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list