• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Overall Architecture

 
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would agree with Michael... the main that that you need is one main interface so that the client can deal with one, and not care which mode it is in.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nate & Michael,
Thanks for the reply. Now I understand of advantage of using just single interface. But I got another question is:
In the client Facade whenever client call those methods in the implementation class that implemented the DataInterface, client need to try & catch both RemoteException, DatabaseException etc. even if client's connection is LOCAL. Is there any other way to work around with this?
 
Nate Johnson
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is just what I did. Then I wrapped (with exception chaining) up the exceptions in a FBNException, with a useful message for the user. Then, my view only had to deal with one type of exception and display a nice pop-up to the user.
I would be interested in hearing other people's solutions to this as well.
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pretty good exception handling Nate. What I did was have a catch block for each possible exception starting with the most specialized and ending with the generic Exception. Each block triggered a specific dialog based on the exception type.
Michael Morris
 
CyJenny Wong
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

That is just what I did. Then I wrapped (with exception chaining) up the exceptions in a FBNException, with a useful message for the user. Then, my view only had to deal with one type of exception and display a nice pop-up to the user.


Hi Nate,
Can you give me one example of how you did the above.
 
Nate Johnson
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First you need to know what exception chaining is, so here is a good start on that...
Author: Brian Goetz
Article: Exceptional practices, Part 2
http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-exceptions-p2.html
Exception chaining is provided by JDK 1.4, but I emailed Sun and they told me not to use 1.4, so I had to use Brian's class to get the same out of 1.3.
Ex:

and then catch the FBNExceptions in your view and display an nice pop-up with the message from the exception.

The really nice thing about chaining exceptions is that you keep appending the stack traces on to each other and you will have a great debugging report to give back to the developers when problems occur (that is if you code has a bug in it )
Hope that helps...
[ August 17, 2002: Message edited by: Nate Johnson ]
 
CyJenny Wong
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nate,
So where should I packaged the FBNExeption & ChainedException classes?
 
This is awkward. I've grown a second evil head. I'm going to need a machete and a tiny ad ...
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic