Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

object by value passing in rmi  RSS feed

 
jawwad ahmed
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well i was practicing rmi.I can't find the reason what is the benefit of passing object as value and what is disadvantage of passing by reference if there would be a support in rmi.
Thanks.
Jawwad Ahmed
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jawwad ahmed:
Well i was practicing rmi.I can't find the reason what is the benefit of passing object as value and what is disadvantage of passing by reference if there would be a support in rmi.
Thanks.
Jawwad Ahmed

In short, if the return type of a remote method happens to be a serializable, the client gets a local copy of the same. So any subsequent method invocations on this copy again turns out to be local method invocations. ie you have ended up caching information which is generally considered to be good.
If the return type happened to be remote then all the method invocations on tnat object w'd result in calls across the network which is costly.
So you will have to decide on whether you need to make an object implement Remote / Serializable
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!