[Zope-CMF] Small CMFCatalogAware refactoring

Sidnei da Silva sidnei at enfoldsystems.com
Mon Sep 12 08:04:17 EDT 2005

On Mon, Sep 12, 2005 at 01:46:00PM +0200, Jean-Marc Orliaguet wrote:
| Julien fixed a bug. Only poorly designed software implements hardcoded
| references to paths ('portal_catalog'). And he needed it to implement a
| separate catalog for portlets. So let's move on....

Sorry, but I totally disagree with that. CMFCatalogAware is not the
only place that has references to portal_catalog. There are a couple
other references spread around CMF. Either you come up with a CMF-wide
fix and a proposal, or you make that change somewhere else.

I, for once, would instead make 'getToolByName' hookable so that it
can return a different 'portal_catalog' based on whatever constraints
you need to distinguish which catalog to use, and then ensure
'getToolByName' is used all around where a catalog is needed.

For the records, whatever is the plan for Zope 3-ification of the CMF,
the first place that should be touched is 'getToolByName' IMHO.

Sidnei da Silva
Enfold Systems, LLC.

More information about the Zope-CMF mailing list