At some level in the code IOException and SqlException are part of the domain model. They should just not be allowed to bubble up.

   Peter


On 27/06/10 18:19, Kevin Wright wrote:
There's a school of thought stating that checked exceptions are okay for domain-level concepts, but not low-level stuff. So SaveFailedException would be allowed, but IOException, SqlException and their derivatives wouldn't.


OTOH, It probably makes more sense to just return a status flag (or some other way of indicating completion/failure) in methods of this nature, I usually find that control flow reads more naturally that way.



On 27 June 2010 00:04, Paul King <pa...@asert.com.au <mailto:pa...@asert.com.au>> wrote:


    Checked exceptions are a useful language feature and should be
    used liberally in cases where you know all possible use cases for
    your code in advance and require handling of the exceptions by the
    caller because it makes sense for them to always handle it. For
    code which you want to reuse for generic use cases they usually
    become an anti-pattern.

-- You received this message because you are subscribed to the Google
    Groups "The Java Posse" group.
    To post to this group, send email to javaposse@googlegroups.com
    <mailto:javaposse@googlegroups.com>.
    To unsubscribe from this group, send email to
    javaposse+unsubscr...@googlegroups.com
    <mailto:javaposse%2bunsubscr...@googlegroups.com>.
    For more options, visit this group at
    http://groups.google.com/group/javaposse?hl=en.




--
Kevin Wright

mail/google talk: kev.lee.wri...@gmail.com <mailto:kev.lee.wri...@gmail.com>
wave: kev.lee.wri...@googlewave.com <mailto:kev.lee.wri...@googlewave.com>
skype: kev.lee.wright
twitter: @thecoda

--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to javapo...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.

--
You received this message because you are subscribed to the Google Groups "The Java 
Posse" group.
To post to this group, send email to javapo...@googlegroups.com.
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to