Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird 1.3.3. Wrapping RemoteExceptions

 
Chris Popz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks:

On the client side I have a DataProxy class that implements the DBMain interface and that delegate method calls to the remote Data class.
Since the DBmain interface doesn't throw RemoteExceptions I cannot throw RemoteExceptions from the DataProxy class methods. However, I would like the users of the application to be notified in case of any networking problems, thus I've been considering catching the RemoteExceptions in the DataProxy class and "rethrowing them" as NetworkFailureException, which extends RuntimeException, and finally catching the NetworkFailureException in my controller class, which then informs the user of the raised error...
Do you think this would be a valid design? Am I breaking the "networking must be entirely bypassed in the non-networked mode" paragraph, by cluttering the controller code with "NetworkFailureException" catch clauses? (The latter is surely a stupid question, but is raised just to be 100% sure...)

Regards

Chris
[ May 14, 2007: Message edited by: Chris Popz ]
 
Lucy Hummel
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,

I do not use the interface that Sun gave me as the interface between client and server, so as network layer. So the implementation of Sun's interface does not throw any RemoteException. Instead I have a facade between client and server, the network layer, that throws the RemoteException.

What I can propouse to use the search feature and you are going to find already answers and suggestions to your question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic