[Zope-CMF] Re: [dev] refactoring listFilteredActionsFor: 2 questions
Yuppie
schubbe at web.de
Sat Nov 22 03:03:16 EST 2003
Hi!
Tres Seaver wrote:
> I think Yuppie is "kicking against the goads" here ;).
Doesn't feel like that ;)
> 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.
Well. I could live with your solution, it's a good alternative and no
big deal to implement. But I would feel better if I'd understand what's
wrong with my approach.
>> > 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!
That was my first trial. The code I checked in on a branch uses REQUEST
to store the cache.
>>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.
Not if you take care about that issue. See
<http://cvs.zope.org/CMF/CMFCore/Expression.py.diff?r1=1.5&r2=1.5.44.1>
Cheers,
Yuppie
More information about the Zope-CMF
mailing list