Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

two objects implementing same remote interface

 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If two or morethan one object implements the same remote interface ,

are those objects equal.do they can not have different data.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Even if the same implementation is bound as another name in the RMI registery, each can hold different data.

Another problem is with the "equals" method - if a client calls "equals" on two stubs, the default "equals" method that tests object identity is used, which isn't going to return true unless you have the exact same stub. "equals" isn't going to test actual data equality on the server.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic