I have a few configuration flags that I want to be able to set on/off via an http call (similar to a REST call).
Normally you store configuration settings in the web.config, or you pull things our from a file into a class, and this configuration class that you use throughout your application code is used as if it a singleton class or constants.
There is one property that I want to be able to modify at runtime, and this is a global variable. Any modifications will be done by a single user or thread, and will occurr very rarely.
How should I design this and where should I store this?
My application code calls the Twitter API, but I want to be able to switch on/off if I should call the twitter API (it could be down), where should I store this on/off property knowing that I want to be able to update this field?
if(SomeClass.TwitterApiEnabled)
{
// call twitter api
}
I could toggle the TwitterApiEnabled property on/off using:
http://www.example.com/api/twitter/enable=no&auth_token=123