• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

objects passed by reference

 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the differnece in the code when objects r
passed by reference in RMI?
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At client side there is no difference.
In RMI you can pass the object by two ways
1) BY value.
2) By Reference
Object passed by value are serialized over the network and a new copy is created at the client side.
whe the object is passed by reference original object resideds at client side. only reference is passed to the client.
(in RMI this object should implement java.rmi.Remote interface)
Although at client side there is no diff. you can call any method of remote object s it resides in your machine . RMI takes care of everything.
hope itgives your answer

------------------
 
Author
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i guess there might be performance implications depending on the kind of use you make of the objects?
serializing an object is a significant task, but then so is a callback across the wire - would this not make a difference
chanoch
 
mukund kulkarni
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If we consider perfomance then there we have to have a find out a trade off.
If object is very bulky then it is always better to send it by reference.
however by sending object by reference each time you call any method on it ,it actually goes thro' the network. number of network call increases.
Which one is to use is depends on the content of the object.
 
Manas Ahlaad
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

thanks mukund ,for your valuable answer!
it answerd my question
regards
manas
 
We're being followed by intergalactic spies! Quick! Take this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic