• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error handling , Chained Exception .. please comment

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
I let all methods in my DataInterface interface
to throw Exception because when a class implements this interface and wants to override it's method, no need to worry about if their exception classes are covered by interface, also I didn't create any customized exception like DatabaseException for my client or server side (just throw Exception and catch Exception). but I've read some comments about 'Chained Exception' and now I am wondering if my way is not the right way?
I appreciate your comments

Sam
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sam,
I did not use chained exceptions either and got perfect on exception handling. I'm not arguing either way on the subject since I thing chained exception handling is a great tool to have at your disposal and I believe that the newer 1.4 SDK makes it easier to implement. It just didn't fit well with my design. I used an observer pattern (Observer/Observable) for client-side exception handling. Similar to you, I just caught Exception in the facade, and called the update method on the Observer and then went thru a series of "instanceof" tests to see what kind of exception had been thrown and in what context. So if your exception handling is clear and covers all the bases, I would just go with what you have already done.
Hope this helps,
Michael Morris
 
Sam Stackly
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Michael,
there is one thing I didn't implement so far and It is policy file and SercutiryManager. I appreciate it if you can help me. I run my application in WinXP (both client and server apps) without a problem, I don't know about other OS, when I add a RMISecurity Manager to my server it comes with the ugly applet windows. and I don't know what should I do with it and about policy file, what type of grant should I provide ? do I really need it? well I guess after that I am ready to uplaod
Thanks again for comments
Sam
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sam,
I did install a securtity manager and use a policy file for the server. Initially I was loading RMI stubs dynamically from the client so I needed both. I eventually decided it was better (more logical from a design point of view) to put those classes on the server so I probably needed neither. I do know that, although I required a policy file on the server, that in all tests that I did it would run fine without one. I granted all permission in my policy file. In a real application you probably would want to restrict it to the bare minimum required, but you won't lose any points for full permission so better safe than sorry.
Hope this helps,
Michael Morris
 
Sam Stackly
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thansk again for your comment Michael,
I used RMI Security Manager in server side and I get ugly sceern in all my Frame and JOptionPane (show them like an applet) and it screws all my GUI do u know how can remove this from my fram??
thanks in advance
Sam
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sam,
I really don't know but a wild guess would be that it is XP specific. We've made the decision to steer clear of XP at our company and stay with 2K until we know most of the kinks are knocked out. Is there any way you can try it on a different OS? Sorry, I'm not much help on this. You might want to start a new post with this problem as the topic. There's a good chance someone knows of or has seen this behavior before.
Michael Morris
 
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic