This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLY bird, Exception handling problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLY bird, Exception handling problem" Watch "URLY bird, Exception handling problem" New topic
Author

URLY bird, Exception handling problem

ghanshyam sharma
Greenhorn

Joined: Jan 05, 2003
Posts: 24
Does anyone have an idea regarding this.
The assignment mentions a set of methods as the interface that one MUST implement. Is it possible to add some exceptions to the throw clause of the interface methods without loosing any marks ???
Here is the reason. Using I am trying to have the RMI server s well as the local server return the server class with the same interface which the client can use invisibely. which means I am trying to use the same interface to build my Remote Server as well the local database class. The problem is that using RMI, the remote server implementation needs to throw RemoteException for every interface method that it implements.
Now if I am using the same base interface, the base interface should also throw RemoteException.
If I do not go this way I will have to return different type of objects in case of remote server implementation as compared to teh local server implementation which doesn't sound very good to me ...
Only way is to change the interface and add something like java.io.IOException to every method. Now since RemoteException is a subclass of IOException, I will be able to use the same interface for both local implementation and the remote implementation. My only doubt is does this voilate the MUST condition in the requirement spec ???
Thanks in advance...
-Sharma


Sun Certified Enterprise Architect<br />Sun Certified Java Developer<br />Sun Certified Java 2 Programmer<br />IBM OOAD using UML<br />IBM XML and Related Technologies<br />BEA Certified WebLogic Developer (6/7)
Vlad Rabkin
Ranch Hand

Joined: Jul 07, 2003
Posts: 555
Hi,
My only doubt is does this voilate the MUST condition

I decided not to take a challage. There are many different solutions.
Nobody says that this interface must be used by GUI client. So I use
adapter pattern to provide another high-level interface with all exceptions
and method signatures my GUI client need.
Vlad
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URLY bird, Exception handling problem
 
Similar Threads
how to get Clients CPU information on Server using Java RMI
The Server
Advice upon delete method
Non-Networked Mode
Design questions (with RMI)