How can I implement feature toggle in Java from scratch?

CodeHunter :

I have a requirement to implement feature toggling in my current project. I have no idea how to implement it from scratch in Java.

I have read the theory behind the feature toggling at various articles related to this topic but I haven't yet seen the implementation tutorial or documentation that describe this in detail for a beginner.

mrusinak :

I would recommend taking a look at some existing implementations to get ideas on how you want your system to behave and fits with your requirements. There is a small list at http://featureflags.io/java-feature-flags/, and poking around the web can probably find more.

In the end, you'll need to consider a few things:

  • Where are feature flags stored
  • How are feature flags applied/determined
  • What kind of deployments/rollouts do you need to support

Edit: From personal experience, Launch Darkly has a pretty cool approach where the clients are loaded with the rules engine for determining flag status, which makes it very fast & resilient to the hosted service going down.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=476279&siteId=1