[Zope-dev] Declaring Dependencies for XML documents (Was: How To Improve Cache Coherency for RAM/Disk Cache Manager...?)

Craeg K Strong cstrong@arielpartners.com
Mon, 03 Mar 2003 21:27:58 -0500


Jamie Heilman wrote:

>>Why make the unlucky user pay the price?
>>    
>>
>Because the unlucky user (which I read as: author) is the only one who
>knows the required behavior of their code.
>  
>
Allow me to clarify -- I meant the end user browsing the website.
I hate it when I surf to a less-highly-used portion of a website and
have to wait 30 seconds for the page to render.  

Anyway, after talking this over with my colleague, I realize that
the problem of *deriving* dependencies is fundamentally undecidable.
We might be able to figure it out in the case of simple acquisition,
like 

<span tal:replace="here/aObject/aMethod"/> 

But it is hopeless for pure python:

<span tal:replace="python:I-can-do-anything-and-you-cant-stop-me(REQUEST)"/>
:)

One possibility is to add the ability to *declare* dependencies.
I thought of doing that for an X-path aware "XML Composite Document"
object.   It is an object that produces a valid XML document by grabbing
parts of other Zope objects via XPath/XPointer/XInclude.  

Such an object could have an explicit listing of the objects on
which it depends, and invalidate the cache appropriately whenever
any of the dependent objects changed.

http://www.zope.org/Members/faassen/SimpleCache

Is a nice beginning along these lines.

Thoughts?

--Craeg