Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Feature Toggles

Overview

A feature toggle is a setting which is a collection of features, and the state of those features. This allows you to develop code, have it be tested and released, but not actually enabled. This could also be used to enable custom features for a customer based on what they have paid for.

It will be up to your development practices, but you may wish to make every feature you develop condition. There is overhead in doing this, but this will give you the most robust system possible. Perhaps you can "retire" some feature toggle checks in the future and always have a certain feature enabled.

To understand how this is designed and how you can customize this solution, please refer to setting.

Interfaces:

  1. IFeatureToggleSettings
  2. IFeatureToggleServices

Implementations:

  1. FeatureToggleSettings: This is an abstract class. Default inherited class is FeatureToggleSettingsDefault. You may wish to inherit and implement
  2. FeatureToggleServices

Other:

  1. You can view an alternative implementation which actually uses a webservice to lookup these settings: SphyrnidaeFeatureToggleSettings. Note this implementation gathers customer-specific features and will email out any exceptions that occurred
  2. SettingsFeatureToggle: Static class which you should use to gather any feature toggles.

Where Used

None

Examples

Please reference Settings Example for a detailed review of all customizations.