On Aug 3, 12:41 pm, Matt Bishop <
mbis...@gmail.com> wrote:
> I think your method should return Boolean at the very least. Every
> server call has the potential to fail it's task and throwing an
> exception may not be the best action.
Can you please be specific about when you think throwing an exception
is the wrong action in response to failure? You may be right, but I
don't think so. Adding a Boolean indicator of success seems to me to
add a second channel for communicating success/failure, and clouds the
design. My rule would be (and I don't think I'm the inventor, btw)
"service methods should return values only when the value IS the
service, otherwise not". Custom exceptions are in the language for a
reason.
Walden