ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  An Exception Handling Framework for J2EE Applications
Subject:   useful ideas
Date:   2006-02-12 18:29:58
From:   Shrik
Response to: useful ideas

Here is a catch. Please note that we are not throwing BaseAppException from the methods but its derived classes. In other words we are not throwing just java.lang.Exception but its so many derived classes. Definitely the throws clause just contains BaseAppException but client (ExceptionHandler) will get derived exception classes only, based on the principle of polymorphism. You need to see it from a perspective why do you use a base class in a method signature instead of its derived concrete classes in case you want to use polymorphism. You'll find an answer now on why we just throw BaseAppException.

1 to 1 of 1
  1. useful ideas
    2006-02-13 02:38:01  dario_ [View]

1 to 1 of 1