Overview
A variable is a setting which is commonly used for dynamic run-time configurations. Eg. You can change a configuration at any time, and it should take effect immediately. Depending on your value for CachingSeconds, this will not be immediate, but rather will take effect when the caching period has expired. This does leave a potential gap in the application where 1 server might have the latest variables/configurations, while another server has stale configurations.
It is recommended that you do either:
- Set the CachingSeconds to a period that you can live with (Default is 1 minute)
- Setup a cache invalidation policy whenever these variables/configurations change. Eg. Send() a message to SignalR that the cache item has been removed. If you are using distributed caching, you can simply call the Remove() method (this would be a best practice to do even for a single server)
To understand how this is designed and how you can customize this solution, please refer to setting.
Interfaces:
- IVariableSettings
- IVariableServices
Implementations:
- VariableSettings: This is an abstract class. Default inherited class is VariableSettingsDefault. You may wish to inherit and implement
- VariableServices
Other:
- You can view an alternative implementation which actually uses a webservice to lookup these settings: SphyrnidaeVariableSettings. Note this implementation gathers customer-specific features and will email out any exceptions that occurred
- SettingsVariable: Static class which you should use to gather any variables.
Where Used
None
Examples
Please reference Settings Example for a detailed review of all customizations.