Skip to main content
Question Protected by gnat
1) minor spelling correction; 2) shopping /off
Source Link
gnat
  • 20.5k
  • 29
  • 117
  • 309

throwing runtime exception in javaJava application

I am working as a contractor designing enterprise Java application for my client in the role of a technical lead. The application will be used by end users and there will be a support team who will support the application when we leave.

The other technical leads with whom I am working are under the impression that exception handling will make the code dirty. The system should throw checked exceptions only from the Service triertier and the rest of the code should throw Runtimeruntime exceptions from all other tiers so that there is no need to handle the unchecked exceptions.

I want to hear others experiences on this. What is a need to ever throw a unchecked exception in a business application?

From my experience in the past about runtime exceptions:

  1. Unchecked exceptions make the code unpredictable because they do not show up even in the Javadoc.

  2. Throwing Unchecked exceptions in a business application is non-sense because when you throw it and it goes straight on Users face, how do you explain it to the user? I have seen enough of web application which show "500 -Internal Error. Contact Administrator"500 -Internal Error. Contact Administrator which means nothing for a end user or to the support team managing the application.

  3. Throwing runtime exceptions forces the users of the class throwing the exception to walk through the source code to debug and see why the exception is thrown. This can only be avoided if the Javadoc of the runtime exception happens to be excellently documented which I find is never a case.

throwing runtime exception in java application

I am working as a contractor designing enterprise Java application for my client in the role of a technical lead. The application will be used by end users and there will be a support team who will support the application when we leave.

The other technical leads with whom I am working are under the impression that exception handling will make the code dirty. The system should throw checked exceptions only from the Service trier and the rest of the code should throw Runtime exceptions from all other tiers so that there is no need to handle the unchecked exceptions.

I want to hear others experiences on this. What is a need to ever throw a unchecked exception in a business application?

From my experience in the past about runtime exceptions:

  1. Unchecked exceptions make the code unpredictable because they do not show up even in the Javadoc.

  2. Throwing Unchecked exceptions in a business application is non-sense because when you throw it and it goes straight on Users face, how do you explain it to the user? I have seen enough of web application which show "500 -Internal Error. Contact Administrator" which means nothing for a end user or to the support team managing the application.

  3. Throwing runtime exceptions forces the users of the class throwing the exception to walk through the source code to debug and see why the exception is thrown. This can only be avoided if the Javadoc of the runtime exception happens to be excellently documented which I find is never a case.

throwing runtime exception in Java application

I am working as a contractor designing enterprise Java application for my client in the role of a technical lead. The application will be used by end users and there will be a support team who will support the application when we leave.

The other technical leads with whom I am working are under the impression that exception handling will make the code dirty. The system should throw checked exceptions only from the Service tier and the rest of the code should throw runtime exceptions from all other tiers so that there is no need to handle the unchecked exceptions.

What is a need to ever throw a unchecked exception in a business application?

From my experience in the past about runtime exceptions:

  1. Unchecked exceptions make the code unpredictable because they do not show up even in the Javadoc.

  2. Throwing Unchecked exceptions in a business application is non-sense because when you throw it and it goes straight on Users face, how do you explain it to the user? I have seen enough of web application which show 500 -Internal Error. Contact Administrator which means nothing for a end user or to the support team managing the application.

  3. Throwing runtime exceptions forces the users of the class throwing the exception to walk through the source code to debug and see why the exception is thrown. This can only be avoided if the Javadoc of the runtime exception happens to be excellently documented which I find is never a case.

Source Link

throwing runtime exception in java application

I am working as a contractor designing enterprise Java application for my client in the role of a technical lead. The application will be used by end users and there will be a support team who will support the application when we leave.

The other technical leads with whom I am working are under the impression that exception handling will make the code dirty. The system should throw checked exceptions only from the Service trier and the rest of the code should throw Runtime exceptions from all other tiers so that there is no need to handle the unchecked exceptions.

I want to hear others experiences on this. What is a need to ever throw a unchecked exception in a business application?

From my experience in the past about runtime exceptions:

  1. Unchecked exceptions make the code unpredictable because they do not show up even in the Javadoc.

  2. Throwing Unchecked exceptions in a business application is non-sense because when you throw it and it goes straight on Users face, how do you explain it to the user? I have seen enough of web application which show "500 -Internal Error. Contact Administrator" which means nothing for a end user or to the support team managing the application.

  3. Throwing runtime exceptions forces the users of the class throwing the exception to walk through the source code to debug and see why the exception is thrown. This can only be avoided if the Javadoc of the runtime exception happens to be excellently documented which I find is never a case.