SlideShare a Scribd company logo
Jorge D. Ortiz Fuentes


Mobile Developer Advocate, MongoDB
WELCOME
Implementing Feature Flags
Tell Me Quando
Agenda
What are Feature Flags? Why using Feature
Flags?


Implementing Feature Flags


Three Common Scenarios


Recap
What are Feature
Flags? Why using
them?
A set of constants
that hide or expose
functionality while
it is on development
It is all
about
features
Feature: a characteristic of your
product (has/is)


User Story: a feature from the
perspective of the end-user
Display list of items
Receive notifications about data changes
Add a new item to the list
Persist data locally
New look and feel
Sync with other devices
Animations and eye-candy
…
New Feature
Let s Code Then!
git branch
No!
🙅
It is all
about
branching
Git Flow:


• Main, develop, feature, release, hot-fix…


• Long-lived branches


• Feature code reviews


GitHub Flow:


• Main & feature branches


• Long-lived branches still possible


• Feature code reviews


(Scaled) Trunk-Based Development:


• Trunk/main, releases


• Daily/very frequent


• Smaller code reviews (WIP)
Why not JUST Coding?
Features need time and most likely several steps to complete adding the required code


Fixes might be needed while developing the feature


Some features get discarded after being implemented


Even if they get accepted, they may require


• Some process and


• Waiting for the next version


You need to address your different target audiences: your tests, QA, beta tester production
One Codebase to Rule them all
Implementing
Feature Flags
Make Simple Things Simple
#if THIS_ENABLED {


// New code


#else


// Previous behavior implementation, if any


#endif
Put the
logic in the
code
Different configuration ≠ Feature flags


Use booleans instead of configuration
But where do I set
those flags?
Requirements for the Flag Variables
• Produce different builds for the different audiences from the same codebase


• A feature starts being developed in alpha and it is disabled for any other build


• It is enabled for the next stage when the previous stage is completed
Building with Xcode
List of files (code &
resources) to generate a
product
Target
A set of settings
applied to targets
Build Configurations
Defines actions
combining target and
configuration
Scheme
SWIFT_ACTIVE_COMPILATION_CONDITIONS
Evolution of a Feature Flag
Release
Beta
QA
Alpha
Release
Debug
❌
✅ ❌ ❌
Development
Clean up ➖
Internal test ✅ ❌ ❌
✅
External test ✅ ❌
✅ ✅
Release ✅ ✅ ✅ ✅
➖ ➖ ➖
Xcode
Trickery
Don’t use targets to have different files
for the flags


Use build configurations for each
development stage


Use xcconfig files for each stage, to
enable the flags and use include for
other settings


Configurations can be tuned exposing


$(CONFIGURATION) in Info.plist


Use Product Bundle Identifier if you
want more than one version running on
the same device
Build Configurations
Static vs


Dynamic
Static


• Removes unused code


• Fully controlled by development


• Defined in the project


Dynamic


• All code paths are in the binary


• Behavior can be changed without
rebuilding


• Controlled from elsewhere
Three Common
Scenarios
Three Common Scenarios
Change some logic or how
a layer is implemented


Logic or layer impl.
Change color, text,
position, but keep the
“same” UI structure
Minor View Change
Increase or reduce the
number of views used to
interact with the user
Mayor View Change
Let s Code
Together
CODE REPOSITORY AVAILABLE LATER
https://bit.ly/


sh
2
2
-realm
Minor UI Change
struct MoodButton: View {


let mood: Mood


var body: some View {


Text(String("(mood)"))


.font(Font.system(size: 40))


.padding()


#if NEW_UI


.background(Color.red)


#else


.background(Color.accentColor)


#endif


.cornerRadius(10)


}


}
Major UI Change
@main


struct MoodLoggerApp: App {


var body: some Scene {


WindowGroup {


NavigationView {


#if NEW_UI


NewEntriesListView(viewModel: NewEntriesListViewModel(repository: InMemoryEntryRepository()))


#else


EntriesListView(viewModel: EntriesListViewModel(repository: InMemoryEntryRepository()))


#endif


}


}


}


}
Do I Need to have
Tests in Place?
No! You don’t
need to
But it does help a
lot
Love your future
self and your team
HINT
How do the
tests
change?
Test your old code: feature flag
disabled


Test your new code: feature flag
enabled
Recap
Summary
Feature flags allow to be agile


• Evolve your code without causing disruptions


• Change priorities on the fly


• Tune up deployment


Implementation is easy


• Build configurations


• xcconfig for each of the configuration


• If expression to choose between old and new implementation


Use feature flags not just for domain logic, but alternative implementations, and different UIs
Thank you!
Q&A
Resources
Developer Hub:


https://developer.mongodb.com


YouTube Channel:


https://www.youtube.com/mongodb


Podcast:


https://www.mongodb.com/podcast


https://linktr.ee/unicodeu00d1


Twitter [Me]:


https://www.twitter.com/jdortiz

More Related Content

What's hot (18)

PDF
Designing Auto Generated Codes
Hiroshi Kikuchi
 
PPTX
Angular js training
Rajitha D
 
PPTX
Angular js Training in Hyderabad
CHENNAKESHAVAKATAGAR
 
PDF
A journey with Target Platforms
Mickael Istria
 
PDF
Introduction to DL-BUILDER
ssuserc37b5e
 
PPTX
React Native
Heber Silva
 
PDF
Node in Production at Aviary
Aviary
 
PPT
Eclipse 2011 Hot Topics
Lars Vogel
 
PDF
Java 8 tooling in Eclipse
Noopur Gupta
 
PDF
利用 Appium + Robot Framework 實現跨平台 App 互動測試
Jeremy Kao
 
PPTX
Exploring Android Studio
Akshay Chordiya
 
PPT
Smoothing Your Java with DSLs
intelliyole
 
PDF
Introduction to flutter
龍一郎 北野
 
PDF
Eclipse Luna - What's New!
Noopur Gupta
 
PPTX
Introduction to visual basic
Manav Khandelwal
 
PPTX
What's Coming in Visual Studio v.Next
Jeff Bramwell
 
PPTX
Jetpack Compose - Android’s modern toolkit for building native UI
Gilang Ramadhan
 
PPTX
PowerShell Zero To Hero Workshop!
Daisy Stevens
 
Designing Auto Generated Codes
Hiroshi Kikuchi
 
Angular js training
Rajitha D
 
Angular js Training in Hyderabad
CHENNAKESHAVAKATAGAR
 
A journey with Target Platforms
Mickael Istria
 
Introduction to DL-BUILDER
ssuserc37b5e
 
React Native
Heber Silva
 
Node in Production at Aviary
Aviary
 
Eclipse 2011 Hot Topics
Lars Vogel
 
Java 8 tooling in Eclipse
Noopur Gupta
 
利用 Appium + Robot Framework 實現跨平台 App 互動測試
Jeremy Kao
 
Exploring Android Studio
Akshay Chordiya
 
Smoothing Your Java with DSLs
intelliyole
 
Introduction to flutter
龍一郎 北野
 
Eclipse Luna - What's New!
Noopur Gupta
 
Introduction to visual basic
Manav Khandelwal
 
What's Coming in Visual Studio v.Next
Jeff Bramwell
 
Jetpack Compose - Android’s modern toolkit for building native UI
Gilang Ramadhan
 
PowerShell Zero To Hero Workshop!
Daisy Stevens
 

Similar to Tell Me Quando - Implementing Feature Flags (20)

PDF
An Introduction to Feature Flags
CloudZenix LLC
 
PDF
Launch safely with Feature Flags
Wise Engineering
 
PDF
Feature Flags.pdf
Marc Hornbeek
 
PDF
Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений"
Fwdays
 
PDF
Feature Flags. Reducing risks during shipping changes/
Aleksandr Makhomet
 
PPTX
devops certification
devlabsalliance11
 
PPTX
devops certification
devopsuniversity1
 
PPTX
Basic iOS Training with SWIFT - Part 1
Manoj Ellappan
 
PDF
Ship Confidently with progressive delivery and experimentation.pdf
HeyEmbedMe
 
PDF
Xcode4 userguide Apple
Pragati Singh
 
PDF
Mobile App Feature Configuration and A/B Experiments
lacyrhoades
 
PPTX
Feature flag launchdarkly
Sandeep Soni
 
PDF
Ff for product success
VWO
 
PDF
Feature Toggle
Bryan Liu
 
KEY
TxJS 2011
Brian LeRoux
 
PDF
Feature toggling
T. Alexander Lystad
 
PDF
Building iOS App Project & Architecture
Massimo Oliviero
 
PDF
Programming iOS 4 Fundamentals of iPhone iPad and iPod Touch Development 1st ...
assangkaoua
 
PDF
Peachpit mastering xcode 4 develop and design sep 2011
Jose Erickson
 
PDF
Reliability Patterns for Distributed Applications
Andrew Hamilton
 
An Introduction to Feature Flags
CloudZenix LLC
 
Launch safely with Feature Flags
Wise Engineering
 
Feature Flags.pdf
Marc Hornbeek
 
Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений"
Fwdays
 
Feature Flags. Reducing risks during shipping changes/
Aleksandr Makhomet
 
devops certification
devlabsalliance11
 
devops certification
devopsuniversity1
 
Basic iOS Training with SWIFT - Part 1
Manoj Ellappan
 
Ship Confidently with progressive delivery and experimentation.pdf
HeyEmbedMe
 
Xcode4 userguide Apple
Pragati Singh
 
Mobile App Feature Configuration and A/B Experiments
lacyrhoades
 
Feature flag launchdarkly
Sandeep Soni
 
Ff for product success
VWO
 
Feature Toggle
Bryan Liu
 
TxJS 2011
Brian LeRoux
 
Feature toggling
T. Alexander Lystad
 
Building iOS App Project & Architecture
Massimo Oliviero
 
Programming iOS 4 Fundamentals of iPhone iPad and iPod Touch Development 1st ...
assangkaoua
 
Peachpit mastering xcode 4 develop and design sep 2011
Jose Erickson
 
Reliability Patterns for Distributed Applications
Andrew Hamilton
 
Ad

More from Jorge Ortiz (20)

PDF
Unit Test your Views
Jorge Ortiz
 
PDF
Control your Voice like a Bene Gesserit
Jorge Ortiz
 
PDF
Kata gilded rose en Golang
Jorge Ortiz
 
PDF
CYA: Cover Your App
Jorge Ortiz
 
PDF
Refactor your way forward
Jorge Ortiz
 
PDF
201710 Fly Me to the View - iOS Conf SG
Jorge Ortiz
 
PDF
Home Improvement: Architecture & Kotlin
Jorge Ortiz
 
PDF
Architectural superpowers
Jorge Ortiz
 
PDF
Architecting Alive Apps
Jorge Ortiz
 
PDF
iOS advanced architecture workshop 3h edition
Jorge Ortiz
 
PDF
Android clean architecture workshop 3h edition
Jorge Ortiz
 
PDF
To Protect & To Serve
Jorge Ortiz
 
PDF
Clean architecture workshop
Jorge Ortiz
 
PDF
Escape from Mars
Jorge Ortiz
 
PDF
Why the Dark Side should use Swift and a SOLID Architecture
Jorge Ortiz
 
PDF
Dependence day insurgence
Jorge Ortiz
 
PDF
Architectural superpowers
Jorge Ortiz
 
PDF
TDD for the masses
Jorge Ortiz
 
PDF
7 Stages of Unit Testing in iOS
Jorge Ortiz
 
PDF
Building for perfection
Jorge Ortiz
 
Unit Test your Views
Jorge Ortiz
 
Control your Voice like a Bene Gesserit
Jorge Ortiz
 
Kata gilded rose en Golang
Jorge Ortiz
 
CYA: Cover Your App
Jorge Ortiz
 
Refactor your way forward
Jorge Ortiz
 
201710 Fly Me to the View - iOS Conf SG
Jorge Ortiz
 
Home Improvement: Architecture & Kotlin
Jorge Ortiz
 
Architectural superpowers
Jorge Ortiz
 
Architecting Alive Apps
Jorge Ortiz
 
iOS advanced architecture workshop 3h edition
Jorge Ortiz
 
Android clean architecture workshop 3h edition
Jorge Ortiz
 
To Protect & To Serve
Jorge Ortiz
 
Clean architecture workshop
Jorge Ortiz
 
Escape from Mars
Jorge Ortiz
 
Why the Dark Side should use Swift and a SOLID Architecture
Jorge Ortiz
 
Dependence day insurgence
Jorge Ortiz
 
Architectural superpowers
Jorge Ortiz
 
TDD for the masses
Jorge Ortiz
 
7 Stages of Unit Testing in iOS
Jorge Ortiz
 
Building for perfection
Jorge Ortiz
 
Ad

Recently uploaded (20)

PDF
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
PPTX
Types of Bearing_Specifications_PPT.pptx
PranjulAgrahariAkash
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
PDF
monopile foundation seminar topic for civil engineering students
Ahina5
 
PDF
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PDF
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PDF
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
PPTX
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
PPTX
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PPT
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
PPTX
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
PDF
ARC--BUILDING-UTILITIES-2-PART-2 (1).pdf
IzzyBaniquedBusto
 
PDF
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PDF
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
Types of Bearing_Specifications_PPT.pptx
PranjulAgrahariAkash
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
monopile foundation seminar topic for civil engineering students
Ahina5
 
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
ARC--BUILDING-UTILITIES-2-PART-2 (1).pdf
IzzyBaniquedBusto
 
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 

Tell Me Quando - Implementing Feature Flags