GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE
Go To First  |  Previous Question  |  Next Question 
 J2EE  |  Question 10 of 104    Print  
In Distributable environment,what happens if our component throws an exception(may be checked/unchecked) to others who r using our component. we must handle here itself or let it leave to others to handle? plz. reply soon

  
Total Answers and Comments: 6 Last Update: November 05, 2007     Asked by: ravi 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 09, 2005 14:35:36   #1  
Tijo        

RE: In Distributable environment,what happens if our c...

Hi

With my little knowledge i think we need to handle it. In a distributed environment the object which is been called will be a proxy object to the remote object. So it will be better to handle the error in your component.

Cheers


 
Is this answer useful? Yes | No
December 10, 2005 05:48:58   #2  
ajitamitavdas Member Since: December 2005   Contribution: 8    

RE: In Distributable environment,what happens if our c...
Hi I think the caller of the method should handle the exception
 
Is this answer useful? Yes | No
December 10, 2005 21:09:07   #3  
Soccer Dude Member Since: November 2005   Contribution: 2    

RE: In Distributable environment,what happens if our c...

You know how the exception is to be handled so handle the exception. You however need to let the caller know that an exception had occurred and to take appropriate actions inform the user of the error.


 
Is this answer useful? Yes | No
December 13, 2005 07:47:20   #4  
Ashish        

RE: In Distributable environment,what happens if our c...
It depends on the context of the exception. But usually you may want to wrap the exception in a meaningful way and let the caller know about it. (That's the transparent way of working.) Make sure that the message that the client sees is something that makes sense to the client. For example if your component uses a configuration file then it will obviously throw a FileNotFoundException when it does not find the file. It's a good idea to let the client know which component needed that file and possibly the purpose i.e. configuration. So a message like Component XXX is not able to find its configuration file at this location: YYY is better than the default FileNotFoundException message.
 
Is this answer useful? Yes | No
April 04, 2007 02:03:04   #5  
VenkitaKrishnan Member Since: April 2007   Contribution: 7    

RE: In Distributable environment,what happens if our c...
If your component throws an exception in most cases we should not catch the exception otherwise the calling component will never know that an exception has occured.

What we should do is to force the user of our component to handle the exception so that we can use the stack trace for debugging purpose.

 
Is this answer useful? Yes | No
November 05, 2007 06:18:09   #6  
Mahesh Tpt        

RE: In Distributable environment,what happens if our c...
In exception handling we should use throw clause to throw the exception because exceptions in java are throwable. If any method calls the throw clause it(throw clause) will tell If you call me You must have handle the exception .

So in this situation the caller of that method must have that exception.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape