aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Overall Architecture Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Overall Architecture" Watch "Overall Architecture" New topic
Author

Overall Architecture

Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
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.


scwcd, scjd, scjp<br /><a href="http://natejohnson.us" target="_blank" rel="nofollow">http://natejohnson.us</a><br /><a href="http://rice.kuali.org" target="_blank" rel="nofollow">http://rice.kuali.org</a>
CyJenny Wong
Greenhorn

Joined: May 29, 2002
Posts: 18
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

Joined: May 13, 2002
Posts: 301
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.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
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


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
CyJenny Wong
Greenhorn

Joined: May 29, 2002
Posts: 18
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

Joined: May 13, 2002
Posts: 301
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

Joined: May 29, 2002
Posts: 18
Hi Nate,
So where should I packaged the FBNExeption & ChainedException classes?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Overall Architecture
 
Similar Threads
Should I make local/remote selection screen?
clarification of requirement
How to interpret userguide requirements correctly?
Project reqs and a DataFacade
NT user