This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Local and remote server

 
Sumesh Aravindan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to make sure that what i have understood is right.
When we say local mode, it means that the client will access the server files directly.
If it's in network mode, the client will access the server using RMI. ie, the client will communicate to the server through the stubs that were generated for the remote object.
Thanks,
Sumesh
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by sumesh_aravind:
When we say local mode, it means that the client will access the server files directly.

Well the the client will access a Data object, through an interface, which is bound to a local file.
Hope this helps,
Michael Morris
 
Padmaja Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Morris:

Well the the client will access a Data object, through an interface, which is bound to a local file.
Hope this helps,
Michael Morris

Hi,
I have one doubt. What will be the case when the client is not running on the same machine/JVM as the server(where the database actually resides)? Is that possible to run the databse locally if the client machine is different from the server.
Thanks,
Padmaja
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Padmaja,

What will be the case when the client is not running on the same machine/JVM as the server(where the database actually resides)? Is that possible to run the databse locally if the client machine is different from the server.

That would not be local mode, but remote mode. So in that case you would have to use either RMI or object serialization over Sockets to connect to the public Data interface. Now, you could connect to a file on a different network node in local mode for example "www.mydomain.com/~myaccount/sucertify/db.db" but that would be in the same VM.
Hope this helps,
Michael Morris
 
Padmaja Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Morris:
Now, you could connect to a file on a different network node in local mode for example "www.mydomain.com/~myaccount/sucertify/db.db" but that would be in the same VM.

Hi Michael,
Can you please explain this a little bit more??
Thanks,
Padmaja
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Padmaja,

Can you please explain this a little bit more??

For example:

Both db1 and db2 above are objects in the same VM. The only difference is that they just happen to be using different files on different machines for their backing store. db1's backing file just happens to be on a machine with a DNS name of "www.mydomain.com".
Hope this helps,
Michael Morris
 
Padmaja Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maichael,
Thank you so much.. Now its clear.
Padmaja
 
Sumesh Aravindan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maichael ,
So basically, local mode means that I am accessing the server files using an interface defined specially for the client in non-networked mode(ie,without using RMI).
does it mean that, I don't have to start any server in local mode?
 
Nate Johnson
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way I interpreted it was ...
LocalData implements DataAccess extends Data - so there is a direct, no network, connection to the database.
RemoteData implements DataAccess, Remote and has a reference to the Data on the server - so this connection goes over the network to talk to the database
Both ways the client is dealing with DataAccess objects to talk to the database, so it should not matter which mode it is in to write the client code...
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sumesh,

So basically, local mode means that I am accessing the server files using an interface defined specially for the client in non-networked mode(ie,without using RMI).

You could do it that way, but I agree with Nate that it is better to design a single interface for both local and remote modes, so the client doesn't care whether he's connected to the database locally or remotely.
Hope this helps,
Michael Morris
 
Sumesh Aravindan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael and Nate!!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic