Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confusion.

 
Ruslan Ivanov
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am confused about this project in a few places. Will this app run on 2 separate machines ? If i interpreted right then a lot of posts assume that it will run on single machine. Ok , the problems i am having is where does the db.db must reside on client or on server ? If i place it on Server how will client access DB if it's on different machine. I don't know how this can be. Should there be 2 copies of Data class one on client and on server ?
 
Rick Fortier
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will this app run on 2 separate machines ?
To test the app you should run it on two separate machines. That way you can be sure that you get your security policy correct. It is also recommended that you take your final jar file and install it on a machine on which you have not done so before, following the step by step instructions you wrote for the examiner.
Ok , the problems i am having is where does the db.db must reside on client or on server ? If i place it on Server how will client access DB if it's on different machine. I don't know how this can be. Should there be 2 copies of Data class one on client and on server ?
Think of it this way.
When you are running in remote mode, you are following the client/server model. All access to the db is controlled by the server object. So in this case the client will be talking to the server, and the server will have the file open. The server will have to be able to map a drive to the path specified in your command line parameters.
When you are running in local mode, it is a single user application. All access is coming from one user. In this mode the application will open the file himself. Therefore the file must be in a place which can be mapped to by the single user application.
So, if the single user has a drive mapped E: for example, the file can be in the same directory as the server application (which could be the server's C drive). The same goes for the classpath, you could put the Data class on the server, but this would not be recommended for performance reasons. So you would probably have a separate jar file nested in your main jar file that had everything that the client needs with its own directory structure and own copies of classes it needs. Of course the source code to this is only in one place.
[This message has been edited by Rick Fortier (edited June 07, 2001).]
 
Ruslan Ivanov
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I must be an idiot because i am having a lot of problems understanding client / server programming. The way i understand it is i have 2 or more machines commnunication with each other. So if i look it at it from this point of view i just don't see how this can work out. If i have a db located on client(first machine) and user wants to work in client mode that is fine it'll work. Now server is running on the other machine and if user wants to use server mode how does this work out then ? There is nothing to map to db it's just not there.
 
Rick Fortier
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ruslan Ivanov:
I must be an idiot because i am having a lot of problems understanding client / server programming. The way i understand it is i have 2 or more machines commnunication with each other. So if i look it at it from this point of view i just don't see how this can work out. If i have a db located on client(first machine) and user wants to work in client mode that is fine it'll work. Now server is running on the other machine and if user wants to use server mode how does this work out then ? There is nothing to map to db it's just not there.

In server mode, the server piece opens up the database file and the client talks to the server through its public interface.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic