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

Steve Alexander steve@cat-box.net
Tue, 04 Mar 2003 10:00:04 +0200


(Moved this reply from zope-dev to zope3-dev)


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

Zope 3 includes the means of declaring dependencies between objects. 
Perhaps you could use this to allow a site designer to state the 
dependencies. The caching machinery could query these dependencies.

The important interface is in zope/app/interface/dependable.py. The idea 
is you can probide an adapter to IDependable for any particular kind of 
object.

Most important objects support annotations, and there is a default 
adapter that provides an IDependable for objects that have annotations.
See zope/app/dependable.py.

This stuff could conceivably be back-ported to zope 2.

--
Steve Alexander