cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Dolg (JIRA)" <>
Subject [jira] Commented: (COCOON3-14) Use generics for pipeline assembly
Date Sat, 24 Jan 2009 17:27:04 GMT


Steven Dolg commented on COCOON3-14:

> This gives me following output:
> class test.TestCompoent is PipelineComponent<class java.lang.String, java.util.List<java.lang.String>>

Of course you can do this and use the generic parameters to check for compatibility.
But I don't see how this is any difference than the instanceof check, we have now.
IMO an "component instanceof StAXConsumer" is just as good as an "firstComponent.getOutputType()
== lastComponent.getInputType()".
Of course the latter one looks much more sophisticated but basically you're just checking
for some specific class.

And I also don't see what's the advantage in having one class performing the compatibility
check (and supporting all the little exceptions from the common case which might be necessary
over time) instead of letting the components do it themselves.

I'm still wondering what the input and output type of the SAX components would be and how
the callbacks should be integrated/defined in the PipelineComponent interface.
Maybe we can have an example, so that this can become less speculative.

> Use generics for pipeline assembly
> ----------------------------------
>                 Key: COCOON3-14
>                 URL:
>             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.

View raw message