Women in Technology

Hear us Roar



Article:
  An Exception Handling Framework for J2EE Applications
Subject:   useful ideas
Date:   2006-02-12 13:52:08
From:   dario_
I deal daily with a large team of developers, each of one uses exceptions in a very personal and inconsistent way. I get all the time the same set of reasons as I read in the previous posts, and I notice in those reasons a lack of understanding of the problem (even a denial of the problem)
Your ideas are a starting point to a standardization strategy I'm looking for, and I like them. But I still feel they need some improvement, as throwing BaseAppException in all the methods has some of the drawbacks of always throwing java.langn.Exception.
Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • useful ideas
    2006-02-12 18:29:58  Shrik [View]

    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.