avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject RE: [proposal] avalon 5 ComponentManager interface
Date Mon, 17 Jun 2002 14:00:51 GMT
> From: Stefano Mazzocchi [mailto:stefano@apache.org] 
> 
> Stephen McConnell wrote:
> > 
> > I have to confess that I'm way over on Nicola's side here.  
> The Avlon 
> > framework CascadingException model enables a consitent approach to 
> > handling of causal information that is really valuable.
> > 
> > There may be a perfrmace penalty to the following - but for me its 
> > well and truly justified:
> > 
> >   try
> >   {
> >      doSomething()
> >   }
> >   catch( Throwable  e )
> >   {
> >      throw new CascadingException( "It didn't work.", e );
> >   }
> > 
> > The impact of the above is that I don't need logging 
> statements in the 
> > catch because the full information is pased back to the caller.
> 
> Here,
> 
>  try {
>      componentA = (A) cm.lookup(A.ROLE);
>      componentB = (B) cm.lookup(B.ROLE);
>  } catch (Exception e) {
>      throw new CascadingException("It didn't work", e);
>  }
> 
> the only way to find out which component didn't make it to:
> 
>  1) parse the stacktrace
>  2) get the offending line number
>  3) parse the source file (which might not even be there)
>  4) obtain the offending line
>  5) parse the line to obtain the component.
> 
> result: no way. You have encapsulate each lookup in a 
> try/catch if you want to have this granularity.
> 
> This said, I think the exists() method solves many issues I 
> have with this exception throwing verbosity overhead.
There is also the idea of changing the Exception we
use...


ComponentException
{
    Throwable getThrowable(); // for cascading
    String getRole(); // for determining which component
                    // we failed on...
}

There is more than one way to skin a cat.

The exists() is necessary for optional dependencies,
so it needs to stay no matter how you slice it.


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


Mime
View raw message