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-13 02:38:01
From:   dario_
Response to: useful ideas

I see your point and I understand code will actualy throw derived exceptions, and that by itself is good enough. What I also see is that if I just make a find and replace of BaseAppException for Exception, the design and architecture of the app stay the same, so the need for the BaseAppException is only to differentiate the exceptions that come from my services from the ones that come from third party services and J2SE itself. Not saying that that goal is not enough, just that I feel that all my methods are defined as if they were throwing 'Exception'. May be i'm missing something, but on the other hand, I don't think there's a perfect solution, so this one is good enough for me if I add another rule: if an exception in a method depends on the 'implementation' of the method and not on the concept of the method, wrap it in RuntimeExceptions. This way, if for example I change a File based implementation for a JDBC based implementation, the caller sees no change. After all, the caller has no idea if the implementation, so why would it need to catch the implementation dependent exception?

1 to 1 of 1
  1. useful ideas
    2006-02-13 03:51:31  Shrik [View]

1 to 1 of 1