Hello, my name is Ilia, I’m Android Engineer. Almost three years ago, we started our fintech project. MVP deadline was very optimistic. A week before the release, our team realized that no one was going to postpone the start date, and one feature was unlikely to be completed on time. We didn’t want to take risks and it was decided to cover this part with a stub. By blocking part of the non-working functionality, we had hopes that the MVP scope would be closed. We planned to disable non-working code so that at the click of the CI / Web button, the screen became available to the user.

Step by step, our team increased. Many developers didn’t understand what the system was. The guide was required for the in-house team too. For this reason, we decided to create a separate library. But it wasn't enough… And the development process was modified too.

To be honest, the talks about FeatureToggle integration was a very long time. That story was a trigger.

What is it?

FeatureToggle - is a development instrument that gives the possibility to disable/enable some features depending on the configuration.

Where applicable:

Until we lift the lid, we won't know what's in the pan.

Until we lift the lid, we won't know what's in the pan.

Process movement scheme

Untitled

How to cook?

Now we know everything that we need to start cooking the FeatureToggle. Let’s form all necessary requirements to determine what we have to receive as a result. The system must have the possibility to force functionality, set flexible configurations, override values for different build types and have a remote control. In addition, add required system scalability and protection from unnecessary configuration falling into the wrong hands.

Feature flags can be toggled in the following ways:

data class FoodFeatureToggle(
    val foodType: FoodType = FoodType.BURGER,
) {
    enum class FoodType {
        BURGER,
        HOTDOG,
				;
    }
		companion object {
				val DEFAULT = FoodFeatureToggle()
		}
}
//....
fun showFood() {
		val featureToggle: FoodFeatureToggle = FoodFeatureToggle.DEFAULT
    when(featureToggle.foodType) {
        FoodFeatureToggle.FoodType.BURGER -> showBurger()
        FoodFeatureToggle.FoodType.HOTDOG -> showHotdog()
    }
}