permaculture playing cards*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Bodgitt and Scarper GUI Requirement Confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Bodgitt and Scarper GUI Requirement Confusion" Watch "Bodgitt and Scarper GUI Requirement Confusion" New topic
Author

Bodgitt and Scarper GUI Requirement Confusion

Glen Iris
Ranch Hand

Joined: Jul 13, 2011
Posts: 164

Hey All,

The following requirement is listed as one of the bullet points under the heading The User Interface in my instructions.html:
The program must allow the user to specify the location of the database in both standalone and network mode and persist the db configuration details in suncertify.properties file. The application must read the properties file to determine the location of the db and display the data from the db.


Does this mean I need to allow the user to tell the system where db is located via the GUI? I assumed that the user would find the suncertify.properties file and change the value themselves if they wished to move the db.

If this is the case, does my program need to allow the user to change the location of the db at any time during operation?

Thanks,

G


OCPJP 6, OCMJD
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

You can't expect a user to look for suncertify.properties and make the adjustments manually.

Before my main window (client and server application) shows, I show a simple dialog which asks for the necessary information in order to start the application.


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

Joined: Jul 13, 2011
Posts: 164

Thanks Roel. Its not something I would have thought of as im used to trawling around looking for .properties files in my day to day work.

So you dont think there is a need to offer the user the ability to move the db during operation?
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

You are (I assume) a developer, not a mediocre user.

The dialog offers in standalone mode the possibility to relocate the application to another database file. In server mode you can also change the database file location and the port number the server will be listening on. In network client mode the user can change the server location (ip or host name) and the port number it's running on.
Glen Iris
Ranch Hand

Joined: Jul 13, 2011
Posts: 164

Thanks again Roel.
Helen Ma
Ranch Hand

Joined: Nov 01, 2011
Posts: 451
I was confused by this requirement too. After my analysis, it should be like this:
1. Developer create a properties file that stores:
dbLocation = ..\code\suncertify\db\db-xxx.db
portNumber = 1099

That means the dbLocation specify the relative location of the db file and the portNumber by default is 1099. In NetBean platform or Eclipse, we must create a folder called code to store all our code. Our classes files are all stored in bin directory. So, the relative location shows to move a directory up, look for code\suncertify\db for the file

2. Users start the application and the dbLocation and portNumber are filled in the window.

3. A user may want to change either or both information. For example, this user changes portNumber from 1099 to 8080.

4. After step 3, the new portNumber is saved in the properties file.

5. Another user starts the application and this user's portNumber is 8080.


Another scenario:
1. Two users start their own application.
2. One user changes the port number to 8080 and the port number is saved in the properties file.
3. Should the second user see the change of 8080 as well?

Another scenario:
1. In network mode, a user starts the network server and the port number is 1099 by default based on the properties file.
2. When the user start the client side and update the port number to 8080, this user must get an error message "can't connect to server with 8080".
Is this what developer should do?
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

Helen Ma wrote:dbLocation = ..\code\suncertify\db\db-xxx.db

I didn't store a default database file location, because that's impossible to know where a user has stored the database file.

Helen Ma wrote:3. Should the second user see the change of 8080 as well?

If 2 users use a different computer to run the application and 1 user changes the port number, the other user will not see this change (because it's only changed in the local properties file on the computer of 1st user).

Helen Ma wrote:Is this what developer should do?

If the user provides a wrong port number, he should get an error message of course.
Helen Ma
Ranch Hand

Joined: Nov 01, 2011
Posts: 451
Thanks for your reply, Roel.

But the instruction specifies that "All configuration must be done via a GUI , and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties"

The configuration consists of DB file location and port number that connects to the RMI / socket server.

I think the instruction requires us to persist the DB file location and port number in the properties file. In real-life application, users put their configurations in a properties file, so that they don't need to configure them next time they start the application.

I guess this persisting of configuration is required for the exam to simulate real-life applications.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

If my application starts a dialog is shown where user can enter the configuration details as needed. When everything is fine, these details are saved into a file suncertify.properties (in the current working directory). When the user starts the application again, the dialog is shown again and the configuration details are loaded from the suncertify.properties file (which the user can change or just leave them as-is). So the configuration information is persistent between runs.
Benjamin Ng
Greenhorn

Joined: Jul 12, 2012
Posts: 13
Roel De Nijs wrote:If my application starts a dialog is shown where user can enter the configuration details as needed. When everything is fine, these details are saved into a file suncertify.properties (in the current working directory). When the user starts the application again, the dialog is shown again and the configuration details are loaded from the suncertify.properties file (which the user can change or just leave them as-is). So the configuration information is persistent between runs.


sorry to interrupt but i like to check should the configuration be persisted between two different mode run.

For example, firstly i run standalone mode and indicate my db path. The db path is save successfully into the properties file if everything is fine. I close the window. Next i run the network server mode. should
the db path i previously type in standalone mode to be show or should be empty since this is my first time running network server mode?
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

No, there's no need for configuration to be persisted between runs of different modes. It's very unlikely that you'll use the same computer to start standalone mode and network server mode.

If you use same property to store path to database file, then running standalone mode followed by network server mode on same computer the db path will already be provided.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bodgitt and Scarper GUI Requirement Confusion
 
Similar Threads
FileInputStream creating a new File ??
questions regarding to B&S project specifications
Database Location - Bodgitt & Scarper
[URLyBird] What are the persistent properties
NX:Configuration details