[Zope-CMF] Small CMFCatalogAware refactoring

Jean-Marc Orliaguet jmo at ita.chalmers.se
Mon Sep 12 08:03:24 EDT 2005


Sidnei da Silva wrote:

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

Hi Sidnei
the difference is that portal_catalog is both a tool and a catalog
instance (with its indexes, records...). Other CMF tools are just tools
and their path can well be hardcoded in CMF since they provide only
functionality.

/JM


More information about the Zope-CMF mailing list