Sylvain Wallez wrote: > > I had a discussion with Carsten at the GT about the relations > of VPCs with the pipeline object and caching. The whole > question is about we consider that VPCs and pipeline services > must be an implementation of the corresponding Java interface > (Generator, etc) or if it can be a "mini-Processor" that > simply wraps a sitemap evaluation tree snippet. > > If we want them to implement the Java interfaces, that > requires to define "mini-pipelines" that chain the VPC's > components and provide a combined cache key and validity to > the enclosing pipeline object. That leads to loosing some of > the features of the cache that caches up to the latest > cacheable component in a chain (a VPC is considered as as a > single component in this regard). > > If we say that a VPC is a mini-processor, implementation is > rather easy as it just means adding to the Processor > interface some lookup method to get a Processor object that > will be a wrapper around the VPC's instructions. Pipeline > components added by the VPC are added as usual to a single > pipeline chain, as we have today. > > The problem of that second approach though, is that it's not > possible for Java code to lookup e.g. a Serializer that would > be defined by a VPC. Some components in Cocoon use that, e.g. > the SourceWritingTransformer and the ZipArchiveSerializer. > > I prefer the mini-pipeline approach which is simpler and more > efficient than wrapping behind the interface, but we loose > some of the current functionnality. > > Or maybe a good solution can be to combine both approaches: > the sitemap engine will use the mini-processor approach, and > component lookups (which are not that often used) lead to the > creation of a simple wrapper object implementing the Java > interface, but that doesn't care about caching as SWT and > ZipArchiveSerializer don't care about it. > Yes, this sounds like a good compromise. I really think that the usage of VPC should not be any different than using "usual" pipeline components - it should be transparent. I agree that looking up sitemap components outside of the tree processor does really happen not very often, so providing such a wrapper is the best way to go.
So, for implementation VPC the only missing piece is resolving of relative sources, right? Carsten
