This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

how about this design

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on my assignment and I want to take advantage of RMI structure, so I implement the local mode this way: just instantiate an object of the implementation of the RemoteServer interface(RemoteServerImpl). The remote mode is just the normal RMI way. So the client won't know anything about the details of any method. So I can totally control the server without let the client do anything which makes sense because if I want to change any method later, I can just do it on server side. But I didn't see many people do it this way. Why not?
 
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as you don't spawn any custom thread in GUI, why you need the overhead of the LockManager and the locking mechanism? When running in local mode, it is a waste of resources to instantiate the remote object by yourself.
Also when you expand this application in the future to download the _Stub instances dynamically, there is no need to distribute any change made on the server to the client if you don't explicitly instantiate the remote server object at the client.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

so I implement the local mode this way: just instantiate an object of the implementation of the RemoteServer interface(RemoteServerImpl).


local or remote?
Are you using Remote code in your local mode?
Mark
 
michael opto
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. A DataServerImpl instance will be instantiated if the client is in local mode through a DataServerFactory class. I don't understand why I need LockManager. I can just implement the lock and unlock methods in Data class. And the a Data object will be in DataServerImpl class where the details of the public methods in Data can be done.
Comments please!
 
michael opto
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Comment please! Thanks!
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I din't understand your design but if your DataServerImpl extends UnicastRemoteObject then your are using RMI when your client is in local mode. The assignment says we must bypass networking entirely when in local mode.
Although you call the DataServerImpl methods locally, not through RMI, I think an UnicastRemoteObject instance puts itself to listen to a port so your object may be somewhat reachable from outside.
(I'm new to RMI so don't trust me blindly )
You don't need a LockManager, but as the lock mechanism may be complicated and has data of its own, having a LockManager is advisable.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic