cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject AW: [C2]: Proposal for caching
Date Thu, 25 Jan 2001 09:26:49 GMT
Hi all,

is noone else except Sergio and me interested in having a 
caching mechanism? 
I repeat it: I have NOW time to do some work, but WE need
a concept which all agree on. So please join in and give
your comments. Personally I would like some "+1"s to
start :-)...

> Sergio Carvalho wrote:
> I agree with you, *if* we can't make the assumption that 
> transformers depend only on their XML input. I am really treading 
> on unkown territory here, as I don't know C2 basic design 
> principles. If transformers get data from sources other than 
> those declared in the sitemap, you are 100% right. If, on the 
> other hand, transformers get data from sources declared on the 
> sitemap, then you can check if sources are dirty and deduce when 
> the transformer's output is dirty. And you can cache only the 
> final result on the pipeline. Aggregators aggregate pipelines, so 
> each aggregated pipeline has a cache.
Some transformers get data from sources other than those declared in 
the sitemap ,e.g the SQLTransformer or the XIncludeTransformer.
Especially for the SQLTransformer it is not visible in the sitemap
where the data comes from. If someone can judge if the content has 
changed in this case the transformer is the one.
The scheme applies for all transformer which get "external" data,
e.g. a transformer for querying EJBs, doing RMI, Corba etc.
> Our discussion really revolves around what is a transformer. Can 
> a transformer get data on its own, or is all data fed by Cocoon 
> to the transformer? This applies to  question 8 also. 
Yes, I agree. I think the scenario above gives the answer.
Perhaps some other can help us out here?
> Why wondering which parameters you may want to pass to the 
> validator when you can just replace the whole validator if you 
> design it to be replaceable. Something like:
>   <map:match="test">
>     <map:generate src="http://myserver/resource.xml" type="http">
>         <parameter name="validator_class" 
> value="com.criticalsoftware.web.FooBarValidator"/>
>     </map:generate>
> What do you have against this?
OK, now I get what you meant. I think it is really a good idea. It would
lead to a repository of possible, configurable validators (equivalent
to the repository of generators, transformers etc.) and the sitemap
designer chooses the right validator for the component.
But it is not possible to write validators which are usable for any 
component as only the component knows which data to test. So you
have a tight coupling between a component and its validators.

Quickly thinking I see a possible solution:
Each component declares his own usable validators which can only be used
with this component:

    <map:generator label="content" name="file" src="org.apache.cocoon.generation.FileGenerator">
           <map:validator name="fileChangedValidator" class ="org.apache.cocoon.validation.FileChangedValidator"/>
     <map:generate src="http://myserver/resource.xml" 

What do you think about this?


View raw message