Originally posted by Maria Lepschy:
In my instructions stays:
"the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used".
Does this mean that the user set the file in the directory before he starts the application and fills a text field with this path? I am not sure about this.
How will the user give the path: like C:\Java\Sun\db.db ? or only C:\Java\Sun? How have you do this?
I hope of a quickly answer.
Your programs must not require use of command line arguments other than the single mode flag, which must be supported. Your programs must not require use of command line property specifications. All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.
The mode flag must be either "server", indicating the server program must run, "alone", indicating standalone mode, or left out entirely, in which case the network client and gui must run.
Originally posted by Maria Lepschy:
Thank you Satish.
But you have not answer my question directly- so I have not the answer of my question.
I don't think that in client mode the user has to specify the host and port.
This must be done in server mode. Why should be configured the port in server and port and host in client mode? Client mode means, the client will be run after the server was runing. Or I am wrong?
From the given requirements the appication MUST run in only three modes. These modes are the command line arguments that are specified when we start the application. The ONLY three modes(command line arguments) that are acceptable are "server", "alone" and left entirely(no arguments).
In this mode, we are supposed to enter the "db filepath" and "port" number to start and configure the server. No business functions can be performed here. The only purpose of this is to configure and start the server using a GUI which takes the above said values.
Also called as "standalone mode". In this mode, we have to enter ONLY the "db filepath". That is it. There is no concept of server here. The network is completely bypassed.
left entirely mode:
This is called the "Network Client" mode. What this is means is the server is running on a different machine than that of client. So the client shoud be able to connect to the server and then perform the operations. So what we need to know in this mode is the location of server to connect i.e. the "host" name of the server and the "port" number where the server is listening. If we know these two values, we can connect to the server from a remote client.
My question was only what the setting of the db path means.
What I understand from "Setting of db path" is as you can see, in the above three modes, two modes("server" and "alone") require the location of db filepath.
The file should be copied from the working directory into the specified directory or the file was before the start of application set into the specified path?
We do not copy the file. All we do is before the start of the application, we specify where exactly the db is present. It might be in the current working directory or in a whole different place. We don't know. That is why we set the db file path at start of application. Because first the evaluator may want to test the application with the db present in the current working directory. Later the evaluator wants to test a file from a different directory. Everytime he wants to test, he don't need to copy the file to the current working directory. He can just enter the location at the start of the file, and we set it in properties file. Our Data class works on the db file specified like this.