avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: Defensive Component Question
Date Sat, 19 Jan 2002 05:49:50 GMT
On Sat, 19 Jan 2002 01:00, Berin Loritsch wrote:
> It's a question of what do you make smart, and what are the tradeoffs.
> Naturally, there is a slight performance hit when you place checking logic
> in the component itself (very slight).  The ComponentValidator class can
> be used in either the Container or the Component (or both), and helps
> newcomers learn the system better with fail-quick messages and helpful
> exceptions.
>
> > What is the coding standard for Avalon code? Are cases like this
> > considered a problem in the Avalon class? Or are they only required to
> > not throw NullPointerExceptions etc if the contacts are followed exactly?
>
> If any exception is thrown during the initialization of a Component, that
> Component is no longer valid.  If a valid component ever throws an
> exception that is not part of the contract of the Component (like a
> NullPointerException), then the Component is broken.

I wouldn't say that. There are some exceptions like InvalidStateException 
that can effectively indicate "hey you are using me poorly" - especially when 
the component have no fixed container.

-- 
Cheers,

Pete

*------------------------------------------------------*
| "Common sense is the collection of prejudices        |
|  acquired by age 18. " -Albert Einstein              |
*------------------------------------------------------*


--
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