NicoJuicy / Handlr

Issue tracker for a DMS web application, currently in private beta
3 stars 0 forks source link

Implement feature toggles when going in beta for new features #77

Closed NicoJuicy closed 7 years ago

NicoJuicy commented 7 years ago

A feature toggle is used for enabling features.

The concept is easy:

Keep the old code Add new code in the "if/else"

Turn off when there is something wrong

Should consider it when going live. It's not required now, because i have a "settings" screen which kinda does the same thing. But not in such a clean way

Some examples ( here with a asp.net mvc debug console https://github.com/queueit/FeatureSwitcher.DebugConsole )

https://github.com/jason-roberts/FeatureToggle

List: https://featureflags.io/dotnet-feature-flags/ Alt list: http://enterprisedevops.org/feature-toggle-frameworks-list/ ( winner : https://github.com/AutoScout24/FeatureBee)

PS. While i think about it: I also did something similar for another project. A list of settings ( booleans) in an enum-friendly way, then per user the setting can be set of/on ( + inheritance is available for quickly enabling related features).

There is a T4 template which converts the SQL Table to a Enum, so the following code can be used: if(UserCan(Article.SeeDocuments)){ //insert code here;}

the UserCan is a simple database call, that checks if the user has access to it. There is also a cache for the setting.

The enums are also convert to javascript, so in javascript, you can use the same code. User.Article.SeeDocuments and is bound to a url, eg. /Default/Js . So the features can be used in js and in c# code.

Every change in the settings, clears the cache

It's similar to features, but the last seems to be a better way ( static typed and no real declaration of variables)

NicoJuicy commented 7 years ago

Currently creating a new project in Asp.Net Core with feature toggles, a backend and etc... But it's going to take some time.

I'm going to close this issue, this project is currently in .Net 4.6.2 and can't use .Net core yet. Also, feature toggles are "in a way" implemented with on/of booleans on site level.