• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

Regarding Interface design

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:
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.
G.T. Reddy
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please clarify me
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.
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic