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:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
