avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: [proposal] avalon 5 ComponentManager interface
Date Fri, 14 Jun 2002 14:11:33 GMT
Leo Sutic wrote:

> A lookup failing is an exceptional
> case, and should be treated as such.

I think this is the key issuse here. 

Example, I might change the behavior of a component, if another
component it requires is missing (this happens in Cocoon a lot) 

This is *not* an exceptional case, but a straightforward programming

Making the exceptions thrown a RuntimeException allows people that
consider lookups an exceptional case to use try/catch and those who use
it as a programming flow, to use normal method calls (or ignore the
exists() alltogether)

As for the argument that try/catch enforce good programming practices, I
can point you to a bunch of 

 try {
 } catch (Exception e) {}

examples even in high-quality code that show you this is *NOT* the case:
you can't force programmers to be smart, but you can give them tools
that match their differences.

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche

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