Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Interface design

 
G.T. Reddy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

I designed interface as follws
public interface DataInterface extends Remote{
public FieldInfo [] getFieldInfo() throws RemoteException;
public DataInfo getRecord(int recNum) throws DatabaseException, RemoteException;
.
.
.
}
No I want to modify my existing interface design as follws:
LocalInterface:
public interface LocalDataInterface{
public FieldInfo [] getFieldInfo() throws Exception;
public int getRecordCount() throws databaseException;
public DataInfo getRecord(int recNum) throws DatabaseException;
}
Remote Interface:
public interface RemoteDataInterface extends
LocalDataInterface,Remote {
/* Now all the above methods will be availble here so no neeed to declare again.
}
So local client can get local object and remote client can get remote object.
Now my basic question is how to handle remote exceptions as well as DatabaseExceptions in each interface.
Shall I throw RemoteExceptions in LocalDataInterface so that will be availble to the child interface(RemoteDataInterface).
here I can not throw RemoteExceptions in LocalDataInterface as it doesn't extends the remote.

Am I correct?.

please clarify me.
rgds,
reddy
 
G.T. Reddy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please clarify me
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi G.T.Reddy,
The way you have your design setup is

I may be wrong on this, but I do not think you want DataInterface to extend remote. ( Make Sure Peter does not see it or else he will get angry )
You can code it as follows also
* public interface RemoteDataInterface extends LocalDataInterface, Remote.
All the methods in RemoteDataInterface should throw RemoteException.
Also LocalInterface should not throw remoteException as it is not a remote object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic