[Zope-dev] zpatterns: how to invalidate the attributecache?

Phillip J. Eby pje@telecommunity.com
Sat, 26 Aug 2000 17:00:10 -0500


At 04:32 PM 8/21/00 +0400, Jephte CLAIN wrote:
>"Phillip J. Eby" wrote:
>> I don't see a need for a mass invalidation operation, just more
>> documentation on these inner workings.  :)
>
>or the lack of an attribute depencies mechanism :-)
>if attribute x depends on attribute y from another generic attribute
>provider, invalidation of y doesn't make y to be recomputed.
>

You can do that with a custom attribute provider also.  At this point,
however, I have not run into a situation where I or my developers have
needed that.  In general, we have taken the approach that "dependencies
(such as triggers, indexing, etc.) are only validated/executed at
(sub)transaction boundaries."  In other words, an approach in keeping with
Zope's optimistic transaction approach.

If there is enough demand, I might implement a SkinScript construct to
specify code to be executed immediately after an attribute changes, or to
(semi-)automatically invalidate dependent attributes.  IMHO, however, I
think this sort of situation is one to be avoided if at all possible,
because dependencies have a way of becoming spaghetti (think complex
makefiles).