Originally posted by joel smither:
Need some clarification with respect to the use of the mode flag on the UrlyBird project...
Originally posted by Davinder Kohli:
I have the B&S assignment, I have the same requirement. My thinking is the along the same lines as what you all are proposing or going with. I am using sockets instead of RMI.
Here are my thoughts, please comment...
In my GUI, I provide the Connect menu for the user to provide the db information. In this dialog box, the user may select either Local or Remote.
Local meaning the db is located on the same machine as the GUI, thus requiring no network configuration (thus no server). All the user has to provide is the db location.
Remote means the db server may be located on the same or different machine and requires a network connection. The user has to thus provide IP, port, and db location.
In both the cases, the properties file gets the information the first time and then onwards retains this info.
runme.jar -alone
[There is no server in this case]
The client GUI is brought up and the user must provide the db information, in the connect box which is defaulted to Local.
runme.jar <no flag>
[The server is either on the same machine as the client or on a different box]
The client GUI is brought up and user must provide the ip, port and db location, in the connect box which is defaulted to Remote.
In this case if the db is valid, the client first tries to connect to the Server at the given ip and port and if cannot, then launches the server locally on the client machine. It tests the connection to verify if the db is a valid one.
runme.jar -server
[The server is either on the same or different machine than the client]
A GUI( for the server only) is brought up the first time to get the port and ip and db info and runs the server only. The next time around this information is saved in the properties file, so the GUI is brought up with the information filled up for the user to verify/change.
Now if the user needs to launch the GUI, it needs to run runme.jar without any flag. The user uses the "Connect" menu to provide the db connection information, and can test this connection from the GUI.
Open to suggestions, I have not begun implementing this yet, but I am thinking of going with this.
runme.jar -alone
[There is no server in this case]
The client GUI is brought up and the user must provide the db information, in the connect box which is defaulted to Local.
runme.jar <no flag>
[The server is either on the same machine as the client or on a different box]
The client GUI is brought up and user must provide the ip, port and db location, in the connect box which is defaulted to Remote.
In this case if the db is valid, the client first tries to connect to the Server at the given ip and port and if cannot, then launches the server locally on the client machine. It tests the connection to verify if the db is a valid one.
runme.jar -server
[The server is either on the same or different machine than the client]
A GUI( for the server only) is brought up the first time to get the port and ip and db info and runs the server only. The next time around this information is saved in the properties file, so the GUI is brought up with the information filled up for the user to verify/change.
Originally posted by Paula Decker:
Hi Peter,
I also have B&S. One of your emails read:
According to the Packaging of Submissions section, the database file must be located in the root directory and have the same name as the original file. Given this, I don't see why the user has to enter any db location or information.
Thanks, and I appreciate this thread.
-Paula
Originally posted by Bridget Kennedy:
What you say is true, but there is also a line in the "Network Approaches" section that says "In either case, the program must allow the user to specify the location of the database...".
[ January 05, 2005: Message edited by: Bridget Kennedy ]
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, in which case, the networking must be bypassed entirely.
SCJP 1.4, SCJD
SCJD 1.4<br />SCWCD
Originally posted by Charles Fung:
I do not quite agree. If you read carefully, the requirement is under Network Approaches. 'In either case...' refers to the RMI and serialized objects over socket approaches.
'must allow the user to specify the location of the database, ' means that the client program should be able to specify the location of the server program, i.e. the computer that the server program is running.
In practice, the server must be running before the client starts. When the client starts, you need to tell it where to connect to. The requirement is to prevent hardcoding the server machine.
Also, it is not practical for the client program to specify the location of the database file on the server machine. If you allow the client to specify where to get the database file, different clients may be reading from different files, and that is bad.
Don't get me started about those stupid light bulbs. |