[ 
https://issues.apache.org/jira/browse/COCOON3-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666523#action_12666523
 ] 

Andreas Pieber commented on COCOON3-14:
---------------------------------------

I'm still the opinion that this would not work at pipeline level. The problem 
is that components themself decide which consumer/producer they accept (depends 
on the component type). The first time you come into the situation where 
components have to be mixed (eg. xml and picture components) the 
pipeline-compile-check would fail.

Think about the following situation: A *.xhtml is inserted in the pipe with 
some pictures in it. According to the description in it the pictures could be 
transformed, saved to some place and the urls in the xhtml replaced. In this 
case the pipeline would look like:

X-X-X-XP-P-P-P-PX-X-X

Where X stands for XML-Components and P for picture-Component and XP,PX for the 
"Translators" (Starter and Finisher are not relevant for the example).  This 
situation will work at the moment, but will fail with generic pipes.

Taking the wrong components would fail the first time you create the pipeline 
with a SetupException so that IMO its not a real life problem at all, and more 
an academic problem.

If there really have to be a compile-check it may have to be happen at 
component-level. Does the type of the Producer matches my Consumer (or the 
other way round). At least there's still the option to create a plugin for the 
different IDEs checking this at compile time.

Best Regards,
Andreas

> Use generics for pipeline assembly
> ----------------------------------
>
>                 Key: COCOON3-14
>                 URL: https://issues.apache.org/jira/browse/COCOON3-14
>             Project: Cocoon 3
>          Issue Type: Improvement
>          Components: cocoon-pipeline
>            Reporter: Carsten Ziegeler
>            Assignee: Cocoon Developers Team
>         Attachments: generics.patch
>
>
> This is a simple patch to add generics to the pipeline interface and impl. 
> With additionally introducing marker interfaces for the component types (SAX, 
> Stax, dom)
> this would allow compile time checks if all components have the correct type 
> when assembling the pipeline.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to