avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject Re: [RT] IoC in exception handling?
Date Fri, 29 Jun 2001 13:58:42 GMT
On Thu, Jun 28, 2001 at 11:06:00AM +0200, Leo Sutic wrote:
> > So how about providing, in org.apache.avalon.framework, an ErrorHandler
> > interface and DefaultErrorHandler implementation, just like SAX does?
> > That way, most people can continue to use Java's built-in exception
> > handling, and those who need the extra control can use ErrorHandlers,
> > all within the Avalon framework.
> Jeff,
> the problem I see is that you get much stronger coupling between the
> component and the composer. In order to recover from an error the
> composer/error handler needs to know the state of the component, which is
> implementation specific. (And if the error handler can not recover, what's
> the point? Then it is just a Logger.)

Yes.. I guess an ErrorHandler interface in Avalon would be way too
general. You can only do useful stuff like error recovery in
component-specific ErrorHandlers.

> I prefer components that expose few methods, do a lot themselves, and raise
> exceptions when they simply can not proceed.

I also prefer that, but there's situations which genuinely need extra

> Adding error handlers to each component increases complexity and leads
> to the hyperflexibility syndrome, IMO.

As Pete amply demonstrated in his mail..

> That said, I believe that some components may benefit from using the
> Strategy pattern (provide an object the component can call for further
> orders), like the Pool/PoolController in Excalibur. However, I do not think
> that this needs to be done all across Avalon/Excalibur.

I'll have to look into that.. I guess there's a bigger issue of
composer/component communication.

Thanks for the reply:)


> /LS

To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org

View raw message