aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes BETA Properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "BETA Properties file" Watch "BETA Properties file" New topic
Author

BETA Properties file

Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
Your programs must not require use of command line arguments other other that the single mode flag, and must not require use of command line property specifications. All cinfiguration must be done via GUI and be persistent between runs of the program

Does this mean that I have to create a GUI Dialog for modifying the property file? If so, I guess I should assume a GUI should be created for the server's property file also.
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

Have anyone created a GUI to modify the properties file? I am


Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
Ashik, I am also creating a UI to modify the file. This UI will be displayed before the server or GUI is launched and it will also be responsible for setting the System properties. I wasn't sure if I should do this at first but after I read the requirement that says "You must not require any manual editing of files" I decided to go ahead and create the GUI.
Tybon Wu
Ranch Hand

Joined: Jun 18, 2002
Posts: 84
What configurations are there? Is it for RMI? I use sockets so I don't have any configurations. However, I save the window size and column widths of the table in the suncertify.configuration file. Anyways I think this the configuration file is optional. If you have any configuration, it must be done in the GUI and saved in the configuration file, but it doesn't mean you need to have any configuration at all or what the configurations are.


SCJP2
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

I was thinking that I would ahve a GUI that starts up in the client where they select local or remote mode, and then have a remote IP JTextBox and also a JTextbox for db.db location with a Browse button, and whatever they enter in this screen is saved to a properties file, so that the next time they start up the client these entries would re-appear int he corresponding places.
That is if I can find the time to work on my assignment.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Originally posted by Mark Spritzler:
I was thinking that I would ahve a GUI that starts up in the client where they select local or remote mode, and then have a remote IP JTextBox and also a JTextbox for db.db location with a Browse button, and whatever they enter in this screen is saved to a properties file, so that the next time they start up the client these entries would re-appear int he corresponding places.
That is if I can find the time to work on my assignment.
Mark

That's exactly what I did except that I only let the user choose between non-networked and networked mode and in the latter case, the user must enter the server IP and port... I do not let the user browse for the DB file since the DB file name is frozen to "db.db"... But wait, it could well be that the user has several db.db files on his file system... Hmmmhm, maybe I should add that, too... wondering now :roll:


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
That's exactly what I did except that I only let the user choose between non-networked and networked mode and in the latter case, the user must enter the server IP and port... I do not let the user browse for the DB file since the DB file name is frozen to "db.db"... But wait, it could well be that the user has several db.db files on his file system... Hmmmhm, maybe I should add that, too... wondering now

I'm taking the beta exam and the exam stated that local or remote mode should be specified when executing the runme.jar file. This is why I didn't implement this functionality in the configuration GUI.
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.

Also I don't plan to implement a browse button for selecting db.db because the database file, as stated in the requirements, must be in the root directory of the jar file. The only configurations I implemented in the configuration GUI is the port number, server url, and the name of the database.
I think the location of the db.db, suncertify.properties file, and other files is specified to make things easier for the graders to find. Also, this can hurt someone if they neglect the file seperator because there application will not be platform independent.
What do you guys think?
Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
By the way...I am using RMI :-)
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Nah a Browse button isn't necessary, and yes the command line should tell whether to be local or remote. So I guess the only thing to save then would be the IP address if in remote. Anything else anyone can think of.
Mark
Tom Doyle
Greenhorn

Joined: Apr 23, 2002
Posts: 9
If maintaining configuration parameters is an objective, why not look at the Preferences mechanism that is available in JDK 1.4 and above. The "Java 1.4 Tutorial" by Gregory Travis has an excellent overview of its' capabilities which I highly recommend.


Best regards<br />Tom<br /> <br />SCJP4<br />SCJD6 (B&S in progress)
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
I would be inclined to use java.util.Properties class instead of the Preferences API. It is much more easier to use, and moreover, if we will only be storing 2 or 3 properties there is no need to use the "complex" Preferences API.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: BETA Properties file