This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi there, When I start my RMI-Server, I call the constructor: Data("db.db"). This means that the user doesn't need to specify the name of the database. In local mode the user is able to specify the name (and location) though. I was wondering whether this is a good approach or not. ie: must the user be able to sprecify the database name when in remote mode, or should the server decide which database to select? I Hope someone can help me with this... Greetings Ludo
IMHO: The server should decide. The user should only know the name of the server.
Joined: May 16, 2001
thanks, That was wat I thought too. The problem is that in my assingment the following is written: ... In either case, the program must allow the user to specify the location of the database ... so i'm confused Ludo
I'm also confussed on this issue. My specification states:
"In either case, the program must alow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely."
This statement is located in the SERVER NETWORK APPROACHES section, but it sounds like they are talking about the client. It doesn't make any sense for the Server Network code to have any local database options at all.
If they are talking about the server:
Currently my database assumes that the database file is named "db-2x3.db" and that it's located in the current working directory. This does not satisfy the requirement. I don't have any GUI for my server and there is a requirement that all configurations must be done from a GUI - so I can't configure the location of the server's database file without making a GUI just for that purpose. In a real server application the location of the database file (among otherthings) would be done through a configuration file passed in on the command line. This would allow you to run muliple instances of the server from one binary installation. This is forbidden, however, due to the explicit command line instructions. I could make a goofy server GUI, but I'd like to avoid the extra work if possible.
If they are NOT talking about the server, but the client:
Then I would interpret the "database location" to be the hostname and port of the server. And it makes since to have a local database indicator. And to be on the safe side I'll let the user specify the location of the local database file.
So are they talking about the server or the client?
The ambiguity probably arised from the word "The Program", which, in reality, started like this: java -jar runme.jar
can really be two programs: the client and the server, depending on the arguments placed on the command line to start the application.
So, both my applications, the client app and the server app allow the user to specify where on the hard-drive the database is; and, the client app, of course, can also be told to use a URL for network access instead.
Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. In either case, 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
So database location should be spesified no matter RMI or serialized objects are used. It should also be specified if the application is in standalone mode. If in network client mode, the url must be specified - the server has already been started with the appropriate DB location.
Joined: Apr 13, 2004
Yes the database server has already been started. But how did it get started? Are we required to let the user specify the location of the database file to serve up?
I'm going to err on the side of caution. I'm going to make a GUI for the server and allow the user to select the database file to serve up and the port to run RMI. And give them two buttons to start and stop the server.
Joined: Mar 09, 2004
Hi Marcus, Yes, that is exactly what you need to do.