Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI Server

 
Mark Anderson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm using RMI. I have defined all public methods from the Data class (not implementation) in the Remote Interface.
I can't extend from the Data class to my Remote server since the server must extend java.rmi.server.UnicastRemoteObject. Is it a good idea to put the server in the Data class??
 
Eduard Jodas
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, since the Data class is used locally and remotely, it's better to use delegation.
I'm applying an Adapter/Proxy pattern: a server class which extends UnicastRemoteObject, implements the DataRemote interface and pass method calls to a Data instance. In addition, the server class deals with remote lock/unlock.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic