Sohan's Blog

Living the Developer's Life

Avoid Duplication in Config Files

Any kind of configuration file, be it an ugly xml file or a prettier yml or properties file, its been a source of frustration to me. Here’s a list of few such pain points:

  1. There are two config keys that point to the same value. e.g. db_username=master, data_source_user=master
  2. There are two config keys for urls that point to the same domain, but different paths. e.g. market.com/cameras and market.com/undies
  3. Config entries with placeholders. e.g. weather_url= weather.com/%s or weather_url= weather.com/%s/hourly
  4. Config entries with default values that should not default to anything.
  5. Config entries that are required but don’t fail the application deployment when not set.

Are you having to deal with similar pain points? Some more?