This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Regarding the single command-line parameter which may be provided when running the application, my assignment instructions say:
"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"
I understand this to mean:
- If 'server' is provided *only* the server should start on the local machine - If 'alone' is provided, the program should run in "non-networked" mode - If neither is provided the client and server should both start on the local machine, and the application runs in networked mode
If this interpretation is correct, then there doesn't appear to be any way for a client to connect to a server running on a different machine. If so, what is the point in just starting the server (when the 'server' command argument is provided)?
If neither is provided ... the network client and gui must run
This doesn't mention (explicitely) the server should start on the local machine. So, in my opinion this means that you can start the server either on the local machine or on different machine entirely using the 'server' mode flag. The user probably needs to be prompted for the location of the server when the network client starts. At that moment the user can choose "localhost" or "myhost.mydomain.com" .
Regards, Ronald Wouters
Sun Certified Developer for the Java 2 Platform
Sun Certified Enterprise Architect for the Java Platform, Enterprise Edition 5
Joined: Mar 29, 2005
Thanks for your reply. If the user chooses localhost I guess you could provide an option to "start server now" which they would select if the server isn't already running on the local machine.
I'd be interested to hear how other people interpreted these instructions or if they provided a feature such as the one I'[ve described above
server - start the server, here on this local machine on the specified port. alone - run the program here in non-networked mode nothing provided - run the program here and try to connect to the server on the previously specified port and address.
In my opinion, starting the server on the same machine as the client automatically would be less useful than simply giving an error message if the server could not be located.
Given a network of machines, the server option allows you to start up a server somewhere. If you make your client give you a way to specify the address of the server, the no parameter option allows you to connect to the previously started server.