[Zope-CMF] [dev] refactoring listFilteredActionsFor: 2 questions

Tres Seaver tseaver at zope.com
Fri Nov 21 17:23:31 EST 2003


On Fri, 2003-11-21 at 17:12, Dieter Maurer wrote:
> Yuppie wrote at 2003-11-20 18:23 +0100:
>  > ...
>  > a) caching ExpressionContext
>  > ============================
>  > 
>  > I still don't like to pass ExpressionContext around as argument.
>  > ( <http://mail.zope.org/pipermail/zope-cmf/2003-November/019820.html> )

I think Yuppie is "kicking against the goads" here ;).  Caching an EC
implicitly is going to be an evil bug magnet;  we would be better off
adding a convenience method for constructing one from an object, and
then just requiring clients to pass it in.

>  > So I experimented with storing the ExpressionContext in _v_skindata, 
>  > based on the assumption that
>  > i)  _v_skindata is always available in CMF

_v_ anything is "volatile";  *don't* use it!

>  > ii) _v_skindata is new for each request
>  > 
>  > It seems to work pretty well, but I'm not sure that's a sane approach 
>  > and there might be better solutions. Any ideas?
> 
> Be aware that the same request may call "listFilteredActionsFor"
> (or derivatives) for different objects...

Right;  caching will break badly for anything but the cases which care
only about the "published" object.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com





More information about the Zope-CMF mailing list