[Zope-CMF] Re: Small CMFCatalogAware refactoring

Tres Seaver tseaver at palladion.com
Mon Sep 12 09:21:16 EDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sidnei da Silva wrote:
> 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*.

Not using the "sugary" spelling (calling the interface);  named adapters
are looked up via::

  foo = getAdapter(some_context, IFoo, 'some_name')

I just don't see a usecase for them in what we've outlined so far.


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

iD8DBQFDJYDM+gerLs4ltQ4RAhY/AJ4pKlKM8+2JZLhk5vbApuJ3EvO+sQCfdisf
HPKR4z6clMLoV9EX6GWHu7s=
=jJ22
-----END PGP SIGNATURE-----


More information about the Zope-CMF mailing list