cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: [RT]: InputModules interfaces
Date Tue, 08 Oct 2002 07:58:20 GMT

Sylvain Wallez wrote:
>
> Carsten Ziegeler wrote:
>
> >So, summarizing this, it seems that we agree on changing the InputModule
> >interface to
> >
> >o.a.c.components.modules.InputModule
> >{
> >   Object getAttribute( String name, Map objectModel ) throws
> >ProcessingException;
> >
> >   Iterator getAttributeNames( Map objectModel ) throws
> ProcessingException;
> >
> >   Object[] getAttributeValues( String name, Map objectModel ) throws
> >ProcessingException;
> >}
> >
> >Everyone happy with this?
> >
> >
>
> It looks simpler.
>
> But why throwing a ProcessingException ? Simply throwing Exception would
> avoid exception cascading (I hate these never ending stacktraces) and
> better cope with the variety of implementations.
>
Valid question...now the question is: where do you want to handle the
exception?
If you throw just Exception than the calling code has to test, if the
thrown Exception is a wrapping or non-wrapping exception if it catches
the exception. This results in rather ugly code with several catch
statements.
If you throw ProcessingException than the component has to do this
conversion - personally I like this approach more.

But if you want, we can "change" this to just Exception.

Carsten


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message