• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

degin for exception handling?

 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can someone briefly explain abt the exception handling they used in this appln.
i have a common interface extended by Data classs and server.
right now iam throwing 'Exception' in all the methods. my Data doesnot throw any exception. server thorws remoteexception.
iam concerned abt this design.
pls reply back
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the most part, whenever I had an exception that the client should know about, I wrapped it into a Database Exception, and threw it up the calling chain to the client, which had an exception handler that displayed a pretty JDialog showing a nice message as to the problem.
If the exception was for the Server(I had a GUI for my server), I had another exception handler that would show a JDialog box on the server.
Thats the basics of the design. I would definitely look into how to best handle excpetions. Because to the client, whether there is an IOException, RemoteException or DatabaseException, the user still wants to see something simple to them.
This one one of the big AHAs that I got doing the assignment. Becuase in Foxpro world, which i had come from, this was not a part of the tool, but now I can see the power of it. (The Dark Side of the Force) sorry about
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic