This question already has an answer here:
- When to use Constants vs. Config Files to maintain Configuration 6 answers
In my project I have some constants where I reference almost everywhere:
public sealed class Constants{ public static readonly int MAX_QUAL { get; } = 1080; public static readonly bool CC { get; set;} = false; }
Is it a good practice to store these values in in the application code itself, similar to the snippet above, or in the configuration files (App.config/Web.config/project.json/Manifest.xml etc),
<appSettings> <add key="MAX_QUAL" value="1080" /> <add key="CC" value="false" /> </appsettings>
and then read them through these files on the runtime?
public static readonly int MAX_QUAL { get; } = Convert.ToInt32( System.Configuration.ConfigurationManager.AppSettings["MAX_QUAL"]);
I want to structure the application in a way that non-developers can change these values if it is neccessary, without having to change the source code itself. One scenario is when the provider changes the SDK key while the developer is out for vacation, and someone needs to update these values.