title: Managing configuration in Erlang application
body: <p>I need to distribute some sort of static configuration through my application. What is the best practice to do that?</p>
  
  <p>I see three options:</p>
  
  <ol>
  <li>Call <code>application:get_env</code> directly whenever a module requires to get configuration value.
  <ul>
  <li>Plus: simpler than other options.</li>
  <li>Minus: how to test such modules without bringing the whole application thing up?</li>
  <li>Minus: how to start certain module with different configuration (if required)?</li>
  </ul></li>
  <li>Pass the configuration (retrieved from <code>application:get_env</code>), to application modules during start-up.
  <ul>
  <li>Plus: modules are easier to test, you can start them with different configuration.</li>
  <li>Minus: lot of boilerplate code. Changing the configuration format requires fixing several places.</li>
  </ul></li>
  <li>Hold the configuration inside separate configuration process.
  <ul>
  <li>Plus: more-or-less type-safe approch. Easier to track where certain parameter is used and change those places.</li>
  <li>Minus: need to bring up configuration process before running the modules.</li>
  <li>Minus: how to start certain module with different configuration (if required)?</li>
  </ul></li>
  </ol>