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

Steven Dolg commented on COCOON3-14:
------------------------------------

Although we cannot prevent every misconfiguration of a pipeline with this 
patch, I think it still makes a lot of sense.

If a user knows which type of components (s)he will use, the pipeline can be 
"narrowed down" to accept only those type of components.
If the exact type is not known or a mixture of different components is to be 
used, using

  Pipeline<PipelineComponent> pipeline = ...

will yield exactly the same behavior we have now.

IMO that is the most important aspect of this patch: we do not limit the 
possibilities, while still providing the option to have compile-time checks.

The only drawback I can think of is that we will need a marker interface for 
every "content type" that is to be used.
While we certainly won't need more than one (maybe two) per module, this adds 
another interface to the hierarchy.
Now there were some objections that the number of interfaces already is high 
(or at least higher than expected), but IMO this is absolutely worth it.

Usually I don't bother with the Pipeline module when working on a content type 
specific module.
And declaring my own marker interface for my components (instead of using 
PipelineComponent) is actually a sound approach.
This might also be used to clearly indicate which components are compatible - 
although this would rather be something to be encouraged and probably cannot be 
enforced, since it is only a marker interface.

> 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