16. “While feature toggles are a valuable tool in the box,
they are a second-best option.
The best thing to do with such features is to find a
way to gradually release them into production as you
are building them”
16
Martin Fowler
23. Feature
interface Feature<out T> {
val value: T
val description: String
val key: String
// ...
23
Описание для
тестировщиков
Уникальный
идентификатор
24. Toggle router
interface Features {
val isNewFlowEnabled: Feature<Boolean>
val newAdvice: Feature<String>
val apiUri: Feature<Uri>
// ...
24
25. Самый простой способ
if (features.isWallpapersEnabled) {
wallpaper.visibility = VISIBLE
}
25
26. Изоляция решений
fun openGallery() {
val intent = if (features.isNewGalleryEnabled){
intentFactory.internalGalleryIntent()
} else {
intentFactory.systemGalleryIntent()
}
startActivity(intent)
}
26
27. Изоляция решений
fun openGallery() {
val intent = if (isNewGallerySupported()){
intentFactory.internalGalleryIntent()
} else {
intentFactory.systemGalleryIntent()
}
startActivity(intent)
}
27