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

Handling Remote Exceptions

 
Michel Bertrand
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !
I'm unsure about exception handling involving remote exceptions. In my case,
I implemented one single user interface serving for both remote and local database access. So, in the case of remote access to the database, I have to catch some remote exceptions in the code. At my eyes, it doesn't look so elegant.
How could I isolate this kind of handling, I mean non-functional exception treatment ? Would I be punish when using catch (RemoteException)
in my user interface code ?
Thanks in advance !
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably better not to let your GUI have to handle RemoteExceptions.
Maybe you can use the adaptor pattern to wrap your RMI code to look like a local, non network interface to the GUI side.
Hope you understood that. I didn't explain very well. In a rush.
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michel,
Jacques is correct. Basically, you want you intermediate application layer to catch the exception, then throws a FatalGuiException(or somesuch) to the GUI client. The GUI clients quietly logs the exception, displays a 'system error' messages, and gracefully crashes.
Make sense?
M
[ February 20, 2004: Message edited by: Max Habibi ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic