Posts

Showing posts from April, 2021

Use feature flags in your plugins

Lately, there was a discussion on Twitter about the best practice to handle plugins: One class per plugin? One project per plugin? or anything else? On my side, I'm using one project for all the plugins for the same customer. This is what I answered on Twitter. Then came a question : How do I handle the fact that some plugins may have not been tested or completed yet and I need to release the plugins assembly. The answer was : Feature flag! What is a feature flag? It's a concept that will allow to enable/disable some features or portion of code depending on a configuration. Let's take an example where a plugin must execute two features : Feature A and Feature B public class MyPlugin : IPlugin { public void Execute(IServiceProvider serviceProvider) { var service = new MyCustomService(); service.ExecuteFeatureA(); service.ExecuteFeatureB(); } } We need to find a way to execute conditionally these methods, let's say because feature B