Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Whether the local object and remote object can implement same interface?

 
Hu Yong Jun
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could I make the local object and remote object implementing the same interface?



The remote object's remote methods MUST throw RemoteException. I have the following question:
[BOLD] Can the local object method throw RemoteException but do nothing with the RemoteException or it MUST NOT throw RemoteException? [BOLD]

I must two interfaces such as BookingFacadeLocalIF and BookingFacadeRemoteIF if the local and remote object must not share the same interface. That is a very bad design.

[ October 01, 2004: Message edited by: Hu Yong Jun ]
[ October 01, 2004: Message edited by: Hu Yong Jun ]
 
mike acre
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question.

Personally I believe that no, the local object should not implement an interface that throws RemoteException.

And further more from the clients perspective, in networked mode, it should use a Remote object that doesn't throw a RemoteException, that is to say that the method of Remoteness should be hidden from the client.

The answer lies in the use of Adapters.
 
Anton Golovin
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure it's possible. If your BookingException were to be changed to IOException, then and only then would it work ok.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic