In applications that I write at work, I often need to have an external properties/settings file so that certain parameters can be configurable after the application is deployed with the end-user. The file will usually be text or XML and I will usually be implementing in C++ or Java.
In the past, I have created Singleton classes to manage the injection of these properties/settings into my application. The class would be initialised with the path to a file, be hardcoded with the property keys it is looking for in the file, read it in and store all the attributes. Other classes in the application would then perform a call such as propertySingleton::getInstance().getMyParameter().
The more I read and learn about software engineering, and design, the more this approach feels clumsy and inherently wrong. I was wondering if anyone had to perform similar tasks, and how they would approach this in a well-thought object-oriented fashion?