File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Am I being silly by taking the must too far? Andrews book confuses me. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Am I being silly by taking the must too far? Andrews book confuses me." Watch "Am I being silly by taking the must too far? Andrews book confuses me." New topic
Author

Am I being silly by taking the must too far? Andrews book confuses me.

Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

I was about to hand in my assignment until I noticed "server must start programatically". Fair enough the instructions do say the server MUST run when the runme.jar command is "server". BUT
they also say that if left blank the network client MUST run. Now how do you run the network without entering the host details? This step requires manual configuration and can not be avoided?


SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5603
    
  15

Hi Yucca,

In my application this happens and i think that's what they expect (no manual editing of files, because that's not allowed):

If "java -jar runme.jar server" a window is shown with the appropriate configuration settings. if user enters these config settings and clicks on "start server" button the server is started.

If "java -jar runme.jar" a dialog is shown with the appropriate configuration settings. if user enters these config settings and clicks on connect, the main window application is shown (if the settings were valid of course)

If "java -jar runme.jar alone" a dialog is shown with the appropriate configuration settings. if user enters these config settings and clicks on connect, the main window application is shown (if the settings were valid of course)

Kind regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

Fair enough. But what is the Must requirement saying here? In Andrews book he states that the server must start programatically. This could be understood as "When the server command is provided your server must start immediately and must not require a databse location or or port number to be specified." The MUST requirement that states the server MUST run also indicates that the server must run right away.

The network client will then ofc use the default server port and any allowance for the port to be specified is redundant.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5603
    
  15

Yucca,

checked my instructions html file, but couldn't find anything like "server must start programatically". Is it really in your assignment instructions or is it just in andrew's book.

Kind regards,
Roel
Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

Andrews book, but in my instructions....

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.


My impression is that at that very moment the server is to be running once the command is entered. Any steps that require a database to be browsed for or a port number to be specified indicate that your server is "not" running as instructed.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2268
    
    3

Howdy, Yucca!

Just to give you a position, my approach was exactly like what my good buddy Roel explained above. When running the server (with java -jar runme.jar server), just let the user provide the settings you think are necessary, and with that information, start your server. Also, after my server is started, I just print on the console a message, like, "Server running, press Ctrl + C to exit".


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

Thank you both. Appreciate the help.

Regards Yucca
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5603
    
  15

Hi Yucca,

From your quote from the instructions: "the server program must run", so that's what happens. My server program runs, it shows a window where configuration settings can be entered and then the server starts when user hits the "start server" button.

so in my interpretation there is a difference between the server and the server program. and the server program is started when parameter server is passed as program argument.

starting the server can't be done without having the necessary configuration settings (what is the server port number, where is the database file). So if you want to start the server directly, then someone has to manually edit a file to set the correct port number and the database location). And that's not allowed according to this quote from the instructions


You must not require manual editing of any files by the examiners.


And the most important thing
Roberto Perillo wrote:
my approach was exactly like what my good buddy Roel explained above

and Roberto passed already, so it's a valid approach (my assignment is in grading process at this moment, still 4-5 weeks to go)

Good luck with the essay exam!
Kind regards,
Roel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Am I being silly by taking the must too far? Andrews book confuses me.