Exception handling design
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   shiva_prasad
Posted On:   Friday, September 12, 2003 03:19 PM

I am looking for best way of designing Exceptions for my project. I have two packages: Base and Applicatiion. Any application should be able to use Base package. Base package throws JMSException, SQLException, File I/O related exceptions and some user-defined exceptions. Shall I throw exceptions as they are or shall I wrap them under Basic exception( indicating that Exception is from base package). Is it preferable to have a method throwing list of Exceptions (JMS, SQL, File, Business exceptions) or just a BaseException? If it is simpler to have BaseException, how do I wrap other exceptions under BaseException? What is the best way to go about it. I have some interfaces, abstract classes in base package and they should be expandable in   More>>


I am looking for best way of designing Exceptions for my project. I have two packages: Base and Applicatiion. Any application should be able to use Base package. Base package throws JMSException, SQLException, File I/O related exceptions and some user-defined exceptions.



Shall I throw exceptions as they are or shall I wrap them under Basic exception( indicating that Exception is from base package). Is it preferable to have a method throwing list of Exceptions (JMS, SQL, File, Business exceptions) or just a BaseException? If it is simpler to have BaseException, how do I wrap other exceptions under BaseException? What is the best way to go about it. I have some interfaces, abstract classes in base package and they should be expandable in future. Thanks for any of your guidance

   <<Less

Re: Exception handling design

Posted By:   Lance_Walton  
Posted On:   Tuesday, October 28, 2003 01:50 AM

For an alternative view of exceptions, see the might Bruce Eckel's blog .

Regards,

Lance

Re: Exception handling design

Posted By:   Sean_Sullivan  
Posted On:   Tuesday, October 7, 2003 07:10 PM

For exception handling guidelines,
read Josh Bloch's "Effective Java"

Also, Rod Johnson's
"Expert One-on-One J2EE Design and Development"
has an excellent discussion of exception handling for
enterprise J2EE applications.
About | Sitemap | Contact