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

Adapter pattern for RMI

 
poornima sudharshan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the Adapter Pattern to retrofit my application with RMI.
I have 2 interfaces which has all the methods of Data.
The first one is RemoteDataServiceIF which extends Remote.
The second one is LocalDataServiceIF which does not extend Remote.
On the Server side I have a class FBNServer extending UnicastRemoteObject & implementing RemoteDataServiceIF.
I have a class FBNClient which implements the LocalDataServiceIF -
This class connects to the local or Remote Data instance depending upon a boolean value.
Is this Design okay?
Please reply,
poornima.
 
Mike Wiegand
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
seems that this method presents a duplication of code. If I understand correctly, you will have 2 separate implementation classes, one for client and the other for server. If you add/modify any inner workings, you will have to do it in two places.
Just a thought...
Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic