This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Where classes should be stored?  RSS feed

 
Shay Gaghe
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
im developing a chat program based on RMI.
the chat client program contains a list of clients and a connected id panel with their details( nickname,age,image e.g) , so whenever I move the list highlight on each client the id panel change with the highlighted client information.
As you see I need to make up a cash memory class in the client program which stores the clients information in order to provide a smooth slider action of the id panel.
Since I use RMI I wonder if I need to make this cash memory object under the client or under the server?
Do the RMI registry server actually downloads the remote object to the client computer?
thanks
[
[This message has been edited by Shay Gaghe (edited December 21, 2001).]
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shay -
It makes sense to me to cache all the current users in a list on the server side. The object that stores this could also be remotely available, so clients ask always get the updates from an authoritative source.
The registry doesn't do any downloading at all -- this is a very common misconception and leads to a lot of struggling with RMI in the beginning.
The registry is just a lookup service, nothing more. It tells requesting clients where to find the remote stub they want. The stub is available according to how the server program specifies its codebase -- that's the reason for the "-Djava.rmi.server.codebase= " property in an RMI server program incantation. If rmiregistry does not find the stub it is supposed to bind in its own classpath, it will use this codebase property as the lookup value sent to the client.
Whoever is the codebase resource then sends a stub to the client.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Shay Gaghe
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!