Agile Release Pattern: Feature-On/Off-Switch
A feature-on/off-switch is some mechanism to hide features from a system. A feature-on/off-switch must be able to remove menu items concerning the feature and also to prevent adventuresome users from accessing the feature. It may be as crude as commenting out code (not recommended!), to enabling the feature based on a complex set of conditions (also not recommended).
I’ve encountered features switches triggered by the following mechanisms:
- A configuration file or configuration database table tells the system whether to turn the feature on or off.
- The feature is turned on for users that have a specific role (typically something like BETA_TESTER)
- The feature is turned on when the system is deployed as /foo-preview, but not when the system is deployed as /foo
- The feature is turned on after a specific date. This may seem weird, but was a potential solution when we were waiting for a release of another system and operations-freeze during summer was in effect.
There are probably many more conditions you may use to trigger a feature-on/off-switch. Maybe some of my readers have good examples?
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)