Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When should users be allowed to change the system.properties file?

 
Mxolisi Veco
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day all.

Currently my gui allows users to change the system properties file anytime they like. Next time the gui makes a request, the system uses the latest data contained in the system.properties file.

The ability for users to change servers while the system is already running is not a must and it makes my code longer, clumsy and tricky.

I have decided that I am going to remove the ability to change the system.properties file and remove the complicated coding that goes with it.

The new changes I have made go like this.

On start up, display a dialog that ask for the server name(which is the host machine) and the port number if the mode is SERVER. This dialog contains a save button and a close button. If the user has captured the server name and port number before, he can click close and the system will use the saved properties. If he has not captured these details before he can capture them and click save. If the user captured a wrong server name or port number by accident, he will get connection errors and he will have to restart the application and capture the correct data.

Is this new approach the way to go? Should users be allowed to change the properties file at any time or just on start up only?
 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I am taking an approach very similar to your - dialog box with properties - but without the save button. Upon opening the dialog, the properties file is read, and fills in the server and port (if necessary, i.e., if the mode is client). If the user edits the fields with these properties, and clicks 'connect' and the connections succeeds, I will then overwrite the props file; if the connection fails, the dialog will tell this somehow (or maybe just a simple message box) and the properties will not be updated.
I haven't implemented that yet, but that's the use case that I thought of.

What other properties do you have? Do you only keep the server / port / file name (for local access) or something else, too?

Raf
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mxolisi,

Mxolisi Veco wrote:I have decided that I am going to remove the ability to change the system.properties file and remove the complicated coding that goes with it.
A very good and wise decision

I used following approach:
  • server: a window is shown where user can point to database file and enter port number. When user hits start-button, the server is started. When server can't be started (due to wrong database file for example), an error is shown. The settings are only saved to the properties file when the server successfully starts.
  • standalone client: a dialog is shown where user can point to database file. When user hits ok-button, the client application is started. When it can't be started (due to wrong database file for example), an error is shown (and application exits). The settings are only saved to the properties file when the client application successfully starts.
  • network client: a dialog is shown where user can enter ip (or hostname) of server and port number. When user hits ok-button, the client application is started. When it can't be started (due to wrong port number for example), an error is shown (and application exits). The settings are only saved to the properties file when the client application successfully starts.

  • When during an earlier run configuration settings are saved these settings are reloaded and entered in the appropriate field.

    And as a final remark: in my instructions the properties should be saved in a file called suncertify.properties (not system.properties).

    Kind regards,
    Roel
     
    Mxolisi Veco
    Ranch Hand
    Posts: 59
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Roel.

    Raf I only save server name, port number and the database file name. I do not remember anything else that must be saved other than those three details.
     
    Pieter Jacobs
    Ranch Hand
    Posts: 88
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Mxolisi,

    I have the following entries:

    From the server:
    - Path to database file
    - Port number

    From the Standalone client:
    - Path to the database file

    From the Networked client:
    - Location / Host name
    - Port Number

    Ps: The reason I am keeping separate paths for the different GUIs is purely because I feel that the Server and Clients might run on different machines with different paths. This could probably be debated whether it is necessary, but anyway...

    Cheers,
    Pieter
     
    Mxolisi Veco
    Ranch Hand
    Posts: 59
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Pieter.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic