4

Imagine a software system where you have like 100 parameters, each of which is sensible to change (in my case this is a reasearch system for machine learning). The obvious solution is to store all parameters in a config file, so that the system is easy to handle and see through.

Whis approach is better, what are benefits and disadvantages:

  • a) load the config file at the entry point of the program and pass down a big collection of config variables through each method in the code
  • b) load the config file at the entry point of the program and pass down the relevant collection of config variables through each method in the code
  • c) load the config variables directly where they are needed
  • d) load the config and make it global

I'm open for any suggestion or examples of a particular implementation. At the moment I'm experimenting with nested config variables, each nested object storing config of different modules in the code.

asked Jul 10, 2015 at 0:54

2 Answers 2

2

YAML, JSON or XML are often used in frameworks for managing config settings. Depending on the language you are using, another option can be to use a structured entity (ie in a OO language using a class) to hold your config settings.

answered Jul 10, 2015 at 4:36
0

Like @theatlasroom mentioned use some technique to structure your config-parameters. When that is in place, and since the parameters are "sensible to change" you might consider building some interface for editing them. Having one, it can guard against unreasonable or harmful values (some times entered by mistake) giving the user guidance.

answered Jul 10, 2015 at 6:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.