Originally posted by Adithya Rayaprolu:
This forum is great, it helped me a lot. I am also working on FBN assignment. I have some basic questions.
1. Can I pass program mode(network/local) and database location as command line arguments? Or do I have to provide a dialog box at startup asking the user to enter the mode and location?
2. If I use comboboxes to select origin and destination, I have to get the lists of origins and destination from the database. In our case, the list is small, so this will be fine. what if the list increases? what if the list is changed during runtime?
3. There is a requirement stating that 'If an attempt is made to unlock a record that has not been locked by this connection, then no action is be taken.' This means, we have to somehow get clientID for checking. Can I ignore this? If I do not take the clientID in lock/unlock, is the grader going to fail me?
Beg to differ there. "The user" would be a man or woman behind the counter in a travel agency who might not be able to distinguish their filenames from their hostnames. Presumably, either an IT person will install the application manually, or a set-up program will be written to perform the installation. Either way, a shell script or shortcut link should be set up to start the application with click of the mouse. A dialog is in my opinion inappropriate.
Originally posted by Rick Fortier:
It is easier for the user to be prompted for [program mode and database location]. [...] the command line argument method [...] is harder on the user.
I guess you mean SortedSet?
[...]HashSet will automatically remove the duplicates and sort it for me.
To the contrary , obtaining the client ID is very easy with RMI once you get the idea that every client should get its own DatabaseConnection... RMI will give you free dead connection cleanup to boot.
[Getting the clientID for lock checking] is not easy to do if you chose RMI. [...] Some people are stating "When the program is used as designed, noone will be unlocking things that they did not lock", and ignoring the "current connection" phrase, and passing. Others are creating custom socket factories [...]
Other people have modified the lock/unlock signatures and also passed. I have a friend that actually modified the structure of the database and added a locked column. It made his code alot easier too. And he passed.