I have a console application that I am rebuilding from C to C#. This application has to be able to support the legacy method of storing information like parameters from a command-line and parameters from a file (called the system parameters) that customize each run. The system parameters file is in plain-text with a simple key : value structure.
My questions are:
- Should I combine these different parameters into a single Configuration object?
- How would I call this configuration object from the code to store parameters?
- How would I call this configuration object from the code to retrieve parameters?
- Should this object be strongly-typed?
- I will need access to this structure from a lot of different places in the code, what is the most elegant way to retrieve the values in the object without passing the object itself around everywhere?
I have a feeling that it should be a single, strongly-typed object and that it should be an instantiated object that is retrieved from a repository with a static retrieval method however I really want validation of this method.
Thanks in advance