Meaningless Drivel is fun!
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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLY bird, Exception handling problem" Watch "URLY bird, Exception handling problem" New topic

URLY bird, Exception handling problem

ghanshyam sharma

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 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...

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
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.
I agree. Here's the link:
subject: URLY bird, Exception handling problem
It's not a secret anymore!