Skip to main content
edited tags
Link
Thomas Owens
  • 85.9k
  • 18
  • 211
  • 311
Source Link
WeDoTDD.com
  • 507
  • 1
  • 4
  • 12

When to use Constants vs. Config Files to maintain Configuration

I often fight with myself on whether to put certain keys in my web.config or in a Constants.cs class or something like this.

For example if I wanted to store application specific keys for whatever the case may be..I could store it and grab it from my web config via custom keys or consume it by referencing a constant in my constants class.

When would you want to use Constants over config keys?

This question really applies to any language I think.