cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: validity information
Date Mon, 29 Apr 2002 21:06:59 GMT
<snip/>

> > Let's assume a transformer that inserts data. So this means it's validity
> > depends on....
> >
> > Transformer Output Validity depends on:
> > 1)
> >   a) the validity of the previous pipeline components
> >   b) the validity of the data that get's inserted by the transformer
> >
> > Now the transformer also gathers information that only comes from the
> > pipeline. So the validity of this information only depends on the
> > validity of the previous pipeline components.
> >
> >
> > Gathered Information Validity:
> > 2)
> >  a) the validity of the previous pipeline components
> >
> > What I am trying to achieve is not to change the gathered information
> > when 2b) changes but only when 1a) = 2a) changes.
>
> Hmm, somehow I don't get this. If the validity of the generator does not
> change,
> the same is generated by the generator. If the validity changes, the
> transformer
> is never asked as the whole pipeline is processed then.

...I know it's a bit tricky. I got almost crosseyed thinking about it... ;)
I show you what I like to be able to do:

class MyTransformer {
 setup(...) {
  if (inputComesFromCache) {
    collectData = false; // because I know it's still valid
  }
  else {
    collectData = true; // I am not sure if the data might have changed
  }
 }
}

For several reasons I don't want to collect the data on each transformation. 
it will only change if the file is changed - which means in a more abstract 
way: if the input of the transformer is *not* served from the cache...

Do you see any way of obtaining the "inputComesFromCache" information?
A boolean would be sufficient (still SoC)?

Is it really bad in terms of separation when a transformer can save some time 
because he knows he is facing the same input again?

The problem is: the transformer is hardly cachable because the included data 
comes from an external source and changes quite frequently. So if the 
transformer would only rely on the pipeline caching (and this would depend on 
the included data's validity) the collecting will happen everytime the 
included data's validity changes... which is not very efficient... since this 
happens almost for every request. But everything up to this transformer will 
stay the same! ...see where I am at?

> > > I could imagine writing one pipeline components (stream and event
> > > pipeline) which handles this.
> >
> > Could you please elaborate a bit more?
>
> Currently, you can configure the stream-pipeline and the event-pipeline
> component as either the Caching... and the NonCaching... You could
> implement your own CachingAndForwardValidity... Pipelines and configure
> them in the cocoon.xconf.
> Inside the implementation you could collect the validity objects and pass
> them on to the next step in the pipeline, so the validity of the generator
> can be passed on, let's say as part of the object model or something like
> that to the transformer and so on.
> As you can see by this, it is rather a controlled hack...

Hm... sounds not too bad... don't have the CVS at hand but I fear the Caching 
stream and event pipelines are final, aren't they? (just a guess)
Anyway not too bad...

More thoughts?
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message