Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remote interface and Local interface for BookingManager class?

 
Jianping Wang
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since I adopted RMI, so the Remote interface must be used. I wrote a RemoteBookingManager interface and LocalBookingManager interface. The only different between those two is that all methods in RemoteBookingManager throw RemoteException, nothing else.

Extra effort has to be made to make sure that those two interfaces always remain the same except RemoteException.
Do you have a better solution?
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you could use the search engine to get some alternatives...
 
Carlos Morillo
Ranch Hand
Posts: 221
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jianping,

Check here.

HTH,

Carlos.
 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I code my GUI against the Remote interface (the one that throws RemoteExceptions). The remote implementation does not extend UnicastRemoteObject, so it actually is a simple java object by itself, just throws RemoteExceptions. For client access, I get the _Stub which implements this interface; for local (standalone) access I create the RemoteImpl and use it, but RemoteExceptions can never occur. This way I think it is simple, and the GUI is coded once, but reused no problem in local mode. Note that the RemoteImpl does not use any networking by itself, so local access is compliant to the specs.
 
Jianping Wang
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very Cool Solution!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic