DEV Community

Cover image for Safe .NET Feature Flags with FeatureToggle

Safe .NET Feature Flags with FeatureToggle

Matt Eland on September 21, 2019

Yesterday I wrote on Feature Flags in a largely language-neutral overview article. Today I want to discuss my library of choice for Feature Flags ...
Collapse
 
pcmichaels profile image
Paul Michaels

Not related to the post itself, but how did you implement the '3 part series' thing. I'm guessing it's a funky Markdown feature that I just can't find documented, and you haven't manually just created these tables?

Collapse
 
integerman profile image
Matt Eland

Dev.to automatically does that if you define a series fir multiple articles that share the same name. It's cool, but you can't customize it too much.

Collapse
 
pcmichaels profile image
Paul Michaels

How have you defined it as a series? I initially thought it would be a tag, but it's clearly not.

Thread Thread
 
integerman profile image
Matt Eland

If you're in editor version 2, you click the ... to get the popup with the cannonical URL and series name. Give it a series name. With editor v1, you can set a front matter attribute for the series name.

Thread Thread
 
pcmichaels profile image
Paul Michaels

Thanks!

I never realised there were two versions of the editor! (If anyone's reading this and, like me, can't find it, it's under settings -> misc).

It looks like once you've created your post you're stuck in the version of the editor that you created it is (at least I don't get the fancy new screen when I edit old posts!)

I'm now going to create everything as a series! :-)

Collapse
 
seangwright profile image
Sean G. Wright

Cool! This seems like a good overview of how this library works.

I like Jason Roberts' content on Pluralsight and he seems to have made a real pragmatic library here.

One way I've avoided "scattered strings" used for config is to use the nameof() operator.

public class Config
{
  public const string NEW_DASHBOARD_FEATURE = nameof(NEW_DASHBOARD_FEATURE);
}

This helps keep the value directly tied to the field.


I still have reservations about using a concretion directly, especially a volatile one (it depends on environment specific config) that is new'd up outside the composition root.

This complicates unit testing, effectively requiring integration tests for this section of code.

That said, direct access to feature state/status is easier to understand and requires less architecture.

👍