Reinhard Pötz pisze: > My assumption is that the developer that uses the pipeline knows what he > does.
This is rather good assumption. The problem I can see is that developer has to check sources of each component in order to know what he does as components type does not express what kind of output particular component produces. Or am I missing something? >>> How component can be sure that next component (its consumer) is the one >>> that accepts right type of events? By checking using instanceof? >>> My point is that once we agree to have generic pipelines that can take >>> components accepting/producing any kind of events then we need to invent >>> some mechanism that check if pipeline is built correctly. It shouldn't >>> be a concern of a given component. >>> >>> If we agree on above point, then my suggestion would be to look for a >>> way that pipeline-correctness is ensured by compiler. > > I don't see any way to express this kind of check with Java and AFAICS > your experiments haven't been successful either. It depends how you define being successful. I've managed to express this rather simple idea but the code is horrible thus I consider it as a failure. You probably haven't had a chance to look at my code due to broken GitHub. My question is if there is someone more clever than me that could come up with something more elegant. The check we are discussing is assured by Pipeline interface (look at modified addComponent method): http://github.com/gkossakowski/cocoonpipelines2/blob/master/src/org/apache/cocoon/pipeline/Pipeline.java -- Best regards, Grzegorz Kossakowski
