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

Regarding Interface design

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please clarify me
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic