This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have designed and coded my app to work as follows: First a dialog box is displayed with two radio buttons, one for local database the other for network database. If the user selects local database, the app begins and uses the db.db file in a default location on the localhost. If the user selects network database, a second dialog box is displayed with a text field for the user to enter the remote server's hostname. Then the app begins and attempts to use the db.db file in the same default path on the remote server. I have however, just realized that the requirements state the following: "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". Here's my question: Must I provide a way for the user to specify the path of the db.db file? What is everyone's interpretation of "location of the database"? Might that just mean the machine where the database is located? Thanks for the help, Joe
I believe it is necessary to allow the user to specify the database file location. In addition to the requirement you mentioned, I had a requirement that "the user must not be required to install the files in a specific location." My only required command line argument is "database location". This can either be the path to the file or the binding url for my RMI server. If the user types "local" after this argument it is taken as a file path, otherwise I interperate it as a url. Hope this helps, Matt
Matt/Joe, Can we just put the db.db in a fixed directory within our directory structure. As long as our whole directory structure is loaded in a thecomputer (as long as the examiner sets classpath and path correctly), then we do not need the user/examiner to worry about where the db.db is. The program will work on relative directory. I assume the examiner will set classpath/path, since we do not know where his/her computer setup for the JDK directory. Please comment Ruilin
Joined: Mar 23, 2001
Ruilin, I'm not sure whether or not your approach will meet your requirements, but I don't think it's a good idea to hardcode the location of the database file into the program. If someone wanted to change databases, they'd have to rename their database file "db.db" and move it to the location you have set. By allowing the user to specify the location of the database, the server will be able to service any properly formatted file. The constructor of the Data class takes the filename as an argument, so allowing the user to specify the file location only means getting the argument from the commandline and sending it to the constructor.
Joined: Feb 25, 2001
Matt, Thanks for your great comments. It make a very good sense. Ruilin
Just a clarification required .. IS it a requirement that user can give the db.db file in ASCII format & there should be a routine to convert from ascii to binary ? In submission requirement this point has not been clearly mentioned . thanks for any information provided