jeudi 29 octobre 2015

How to design a class which reads properties from a file

I want to know what is the best programming practice in Java to design a class which reads the properties from a config/ini file. Since properties cannot change during the execution of the program, Is it advisable to make the class as a Singleton class? One of the function to be constructed is read() method which reads configurations from a config file and sets the configurations. Also should i make getters and setters for all the properties derived from the config file.

Aucun commentaire:

Enregistrer un commentaire