avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@citi-us.com>
Subject RE: Exceptions (was: RE: [Avalon4:PROPOSAL] Context Consensus)
Date Wed, 11 Dec 2002 19:37:41 GMT
> From: Leo Sutic [mailto:leo.sutic@inspireinfrastructure.com]
> > From: Noel J. Bergman [mailto:noel@devtech.com] 
> > 
> > > I prefer for the component to [do] the cast and explode if 
> > it fails. 
> > > The responsibility is on the container to catch and log the 
> > exception.
> > 
> > The contract throws ContextException.  There is nothing in 
> > the API contract that says that a container must 
> > intelligently handle ClassCastException, or what it might 
> > mean semantically.
> True, but here we're really going into whether RuntimeExceptions
> should be tested for and caught. In the end I guess it just matters
> how much defensive programming you want to put in. Your example
> is too much for me to accept as a coding guideline, but if you
> want to write code that way...

A *Container* needs to be able to recover from ALL exceptions
thrown by components.  This is a real practical requirement.  If
a poorly written optional component introduces a NullPointerException
or a ClassCastException, and the container does not catch it and
recover from it then the whole application will fail.

It is a QoS (Quality of Service) issue.

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

View raw message