SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
@nikolasburkState Management & Unidirectional Data Flow
State Management &
Unidirectional Data Flow
“Where is truth in your application?”
Andy Matuschak, WWDC 2014
Nikolas Burk
@nikolasburk
• Developer at Graphcool
• Experienced with iOS
• Passionate about programming
paradigms and architecture
1. State Management
2. Unidirectional Data Flow & ReSwift
@nikolasburkState Management & Unidirectional Data Flow
Goals 🎯
State Management
…and why it matters to you
@nikolasburkState Management & Unidirectional Data Flow
@nikolasburkState Management & Unidirectional Data Flow
An Application is more than the
Happy Path
“In the context of software or
information modeling, a happy
path is a default scenario
featuring no exceptional or error
conditions.”
Wikipedia 😏
@nikolasburkState Management & Unidirectional Data Flow
Decision process
for
Slack Notifications
The application state represents the
information that is kept in memory of a
running application and is the basis for the
generation of a user interface.
Application State? 🤔
@nikolasburkState Management & Unidirectional Data Flow
The application state represents the
information that is kept in memory of a
running application and is the basis for the
generation of a user interface.
Application State? 🤔
@nikolasburkState Management & Unidirectional Data Flow
The application state represents the
information that is kept in memory of a
running application and is the basis for
the generation of a user interface.
Application State? 🤔
@nikolasburkState Management & Unidirectional Data Flow
@nikolasburkState Management & Unidirectional Data Flow
The main responsibility of an app is to
transform an application state into a user interface.
(AppState) -> UI
Example: Conference Planner App 🗓
@nikolasburkState Management & Unidirectional Data Flow
struct Conference {
let name: String
let city: String
let year: String
var attending: Bool
}
Application State? 🤔
@nikolasburkState Management & Unidirectional Data Flow
conferences = [
Conference(
name: "AppDevcon",
city: "Amsterdam",
year: "2017",
attending: true
),
Conference(
name: "UIKonf",
city: "Berlin",
year: "2017",
attending: false
),
Conference(
name: "WWDC",
city: "San Jose",
year: "2017",
attending: true
)
]
Application State? 🤔
@nikolasburkState Management & Unidirectional Data Flow
conferences = [
Conference(
name: "AppDevcon",
city: "Amsterdam",
year: "2017",
attending: true
),
Conference(
name: "UIKonf",
city: "Berlin",
year: "2017",
attending: false
),
Conference(
name: "WWDC",
city: "San Jose",
year: "2017",
attending: true
)
]
selectedIndex = 0
Application State? 🤔
@nikolasburkState Management & Unidirectional Data Flow
conferences = [
Conference(
name: "AppDevcon",
city: "Amsterdam",
year: "2017",
attending: true
),
Conference(
name: "UIKonf",
city: "Berlin",
year: "2017",
attending: false
),
Conference(
name: "WWDC",
city: "San Jose",
year: "2017",
attending: true
)
]
selectedIndex = nil
@nikolasburkState Management & Unidirectional Data Flow
1. Where should the state live?
2. Who is allowed to change the state?
3. How does the state get changed?
3 Golden Questions of
State Management 👑
An architectural pattern should be able to answer these questions!
@nikolasburkState Management & Unidirectional Data Flow
Model View Controller
@nikolasburkState Management & Unidirectional Data Flow
Where should state live?
1 👑
@nikolasburkState Management & Unidirectional Data Flow
Who is allowed to change the state?
2 👑
@nikolasburkState Management & Unidirectional Data Flow
How does the state get changed?
KVO & Property Observers
Delegates
Callbacks NSNotificationCenter
Target-Action
3 👑
@nikolasburkState Management & Unidirectional Data Flow
UIViewController
What’s wrong with MVC?
Persistence
Networking
Navigation
Domain Logic
User Interface
Concurrency
@nikolasburkState Management & Unidirectional Data Flow
State Management is
hard
and MVC is not a solution, thanks Apple 😑
Unidirectional Data Flow
… and controlling your application state with ReSwift
@nikolasburkState Management & Unidirectional Data Flow
•
3 Principles
• Single source of truth
• State is read-only
• Changes with pure functions
http://redux.js.org/docs/introduction/ThreePrinciples.html
@nikolasburkState Management & Unidirectional Data Flow
Main Concepts
Store:
… manages the application state
… informs subscribers about changes
Actions:
… describe an intent to change the state
Reducer:
… pure functions that generate a new
application state based on actions
Example Flow
@nikolasburkState Management & Unidirectional Data Flow
Application
State (Old)
AppDevcon
UIKonf
WWDC
Reducer
add Swift Summit
to list and return new
application state
Action
“Swift Summit”
“San Francisco”
“2017”
Application
State (New)
AppDevcon
UIKonf
WWDC
Swift Summit
@nikolasburkState Management & Unidirectional Data Flow
Helpful Resources 📚
• Unidirectional Data Flow in Swift: An Alternative to Massive View
Controllers (Video) (https://realm.io/news/benji-encz-
unidirectional-data-flow-swift/)
• Real World Flux Architecture on iOS (http://blog.benjamin-
encz.de/post/real-world-flux-ios/)
• Redux Documentation (http://redux.js.org/)
• Advanced iOS Application Architecture and Patterns, Andy
Matuschak WWDC 2014 (Video) (http://asciiwwdc.com/2014/
sessions/229)
DEMO
Conference Planner App
Thank you! 🤓
@nikolasburk

Weitere ähnliche Inhalte

Was ist angesagt?

要求定義に効く人間中心設計(HCD)入門
要求定義に効く人間中心設計(HCD)入門要求定義に効く人間中心設計(HCD)入門
要求定義に効く人間中心設計(HCD)入門Rika Waida
 
Data × UX - 定量分析と定性分析のシナジーをガチUXデザイナーが語る
Data × UX - 定量分析と定性分析のシナジーをガチUXデザイナーが語るData × UX - 定量分析と定性分析のシナジーをガチUXデザイナーが語る
Data × UX - 定量分析と定性分析のシナジーをガチUXデザイナーが語るYoshiki Hayama
 
寝プログラミングのススメ
寝プログラミングのススメ寝プログラミングのススメ
寝プログラミングのススメYoshitaka Kawashima
 
マーケティングもリモート×アジャイルに ~ Agile Studio マーケティングチームの事例
マーケティングもリモート×アジャイルに ~ Agile Studio マーケティングチームの事例マーケティングもリモート×アジャイルに ~ Agile Studio マーケティングチームの事例
マーケティングもリモート×アジャイルに ~ Agile Studio マーケティングチームの事例Yukio Okajima
 
Code4lib2023_LT_librarya&AI
Code4lib2023_LT_librarya&AICode4lib2023_LT_librarya&AI
Code4lib2023_LT_librarya&AINanako Takahashi
 
スクラムパタン入門
スクラムパタン入門スクラムパタン入門
スクラムパタン入門Kiro Harada
 
技術文書を書く際の、心技体
技術文書を書く際の、心技体技術文書を書く際の、心技体
技術文書を書く際の、心技体Takahiro Kubo
 
論文紹介: The New New Product Development Game
論文紹介: The New New Product Development Game論文紹介: The New New Product Development Game
論文紹介: The New New Product Development GameHitoshi Otsuki
 
立教大学MBA:AIの最先端技術によるこれからの価値創造
立教大学MBA:AIの最先端技術によるこれからの価値創造立教大学MBA:AIの最先端技術によるこれからの価値創造
立教大学MBA:AIの最先端技術によるこれからの価値創造Osaka University
 
ROSCon発表の振り返りとROSConの振り返り(ROS Japan UG #48 ROSCon 2022ふりかえり会)
ROSCon発表の振り返りとROSConの振り返り(ROS Japan UG #48 ROSCon 2022ふりかえり会)ROSCon発表の振り返りとROSConの振り返り(ROS Japan UG #48 ROSCon 2022ふりかえり会)
ROSCon発表の振り返りとROSConの振り返り(ROS Japan UG #48 ROSCon 2022ふりかえり会)Atsushi Hasegawa
 
”安藤昌也さん”のUX論 ~ 利他的な「私」
”安藤昌也さん”のUX論 ~ 利他的な「私」”安藤昌也さん”のUX論 ~ 利他的な「私」
”安藤昌也さん”のUX論 ~ 利他的な「私」Masaya Ando
 
UXデザインのはじめの一歩を体験しよう! ユーザーインタビューの基本 | UXデザイン実践セミナー 第1回
UXデザインのはじめの一歩を体験しよう! ユーザーインタビューの基本 | UXデザイン実践セミナー 第1回UXデザインのはじめの一歩を体験しよう! ユーザーインタビューの基本 | UXデザイン実践セミナー 第1回
UXデザインのはじめの一歩を体験しよう! ユーザーインタビューの基本 | UXデザイン実践セミナー 第1回Yoshiki Hayama
 
Software-company Transformation
Software-company TransformationSoftware-company Transformation
Software-company TransformationYasuharu Nishi
 
人は一ヶ月でエンジニアになれるのか - 詳細解説
人は一ヶ月でエンジニアになれるのか - 詳細解説人は一ヶ月でエンジニアになれるのか - 詳細解説
人は一ヶ月でエンジニアになれるのか - 詳細解説Livesense Inc.
 
論文の書き方・読み方
論文の書き方・読み方論文の書き方・読み方
論文の書き方・読み方Satoshi Miura
 
アジャイル・スクラム時代のパタン・ランゲージとアレグザンダー理論
アジャイル・スクラム時代のパタン・ランゲージとアレグザンダー理論アジャイル・スクラム時代のパタン・ランゲージとアレグザンダー理論
アジャイル・スクラム時代のパタン・ランゲージとアレグザンダー理論Takeshi Kakeda
 
購入時のメンタルモデルが製品評価に及ぼす影響
購入時のメンタルモデルが製品評価に及ぼす影響購入時のメンタルモデルが製品評価に及ぼす影響
購入時のメンタルモデルが製品評価に及ぼす影響Masaya Ando
 
ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割
ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割
ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割Recruit Lifestyle Co., Ltd.
 
カスタムリスト添付ファイル Power Apps をそえて
カスタムリスト添付ファイル Power Apps をそえてカスタムリスト添付ファイル Power Apps をそえて
カスタムリスト添付ファイル Power Apps をそえてTeruchika Yamada
 
パターン・ランゲージ入門講座(Pattern Language Innovators Summit)
パターン・ランゲージ入門講座(Pattern Language Innovators Summit)パターン・ランゲージ入門講座(Pattern Language Innovators Summit)
パターン・ランゲージ入門講座(Pattern Language Innovators Summit)Takashi Iba
 

Was ist angesagt? (20)

要求定義に効く人間中心設計(HCD)入門
要求定義に効く人間中心設計(HCD)入門要求定義に効く人間中心設計(HCD)入門
要求定義に効く人間中心設計(HCD)入門
 
Data × UX - 定量分析と定性分析のシナジーをガチUXデザイナーが語る
Data × UX - 定量分析と定性分析のシナジーをガチUXデザイナーが語るData × UX - 定量分析と定性分析のシナジーをガチUXデザイナーが語る
Data × UX - 定量分析と定性分析のシナジーをガチUXデザイナーが語る
 
寝プログラミングのススメ
寝プログラミングのススメ寝プログラミングのススメ
寝プログラミングのススメ
 
マーケティングもリモート×アジャイルに ~ Agile Studio マーケティングチームの事例
マーケティングもリモート×アジャイルに ~ Agile Studio マーケティングチームの事例マーケティングもリモート×アジャイルに ~ Agile Studio マーケティングチームの事例
マーケティングもリモート×アジャイルに ~ Agile Studio マーケティングチームの事例
 
Code4lib2023_LT_librarya&AI
Code4lib2023_LT_librarya&AICode4lib2023_LT_librarya&AI
Code4lib2023_LT_librarya&AI
 
スクラムパタン入門
スクラムパタン入門スクラムパタン入門
スクラムパタン入門
 
技術文書を書く際の、心技体
技術文書を書く際の、心技体技術文書を書く際の、心技体
技術文書を書く際の、心技体
 
論文紹介: The New New Product Development Game
論文紹介: The New New Product Development Game論文紹介: The New New Product Development Game
論文紹介: The New New Product Development Game
 
立教大学MBA:AIの最先端技術によるこれからの価値創造
立教大学MBA:AIの最先端技術によるこれからの価値創造立教大学MBA:AIの最先端技術によるこれからの価値創造
立教大学MBA:AIの最先端技術によるこれからの価値創造
 
ROSCon発表の振り返りとROSConの振り返り(ROS Japan UG #48 ROSCon 2022ふりかえり会)
ROSCon発表の振り返りとROSConの振り返り(ROS Japan UG #48 ROSCon 2022ふりかえり会)ROSCon発表の振り返りとROSConの振り返り(ROS Japan UG #48 ROSCon 2022ふりかえり会)
ROSCon発表の振り返りとROSConの振り返り(ROS Japan UG #48 ROSCon 2022ふりかえり会)
 
”安藤昌也さん”のUX論 ~ 利他的な「私」
”安藤昌也さん”のUX論 ~ 利他的な「私」”安藤昌也さん”のUX論 ~ 利他的な「私」
”安藤昌也さん”のUX論 ~ 利他的な「私」
 
UXデザインのはじめの一歩を体験しよう! ユーザーインタビューの基本 | UXデザイン実践セミナー 第1回
UXデザインのはじめの一歩を体験しよう! ユーザーインタビューの基本 | UXデザイン実践セミナー 第1回UXデザインのはじめの一歩を体験しよう! ユーザーインタビューの基本 | UXデザイン実践セミナー 第1回
UXデザインのはじめの一歩を体験しよう! ユーザーインタビューの基本 | UXデザイン実践セミナー 第1回
 
Software-company Transformation
Software-company TransformationSoftware-company Transformation
Software-company Transformation
 
人は一ヶ月でエンジニアになれるのか - 詳細解説
人は一ヶ月でエンジニアになれるのか - 詳細解説人は一ヶ月でエンジニアになれるのか - 詳細解説
人は一ヶ月でエンジニアになれるのか - 詳細解説
 
論文の書き方・読み方
論文の書き方・読み方論文の書き方・読み方
論文の書き方・読み方
 
アジャイル・スクラム時代のパタン・ランゲージとアレグザンダー理論
アジャイル・スクラム時代のパタン・ランゲージとアレグザンダー理論アジャイル・スクラム時代のパタン・ランゲージとアレグザンダー理論
アジャイル・スクラム時代のパタン・ランゲージとアレグザンダー理論
 
購入時のメンタルモデルが製品評価に及ぼす影響
購入時のメンタルモデルが製品評価に及ぼす影響購入時のメンタルモデルが製品評価に及ぼす影響
購入時のメンタルモデルが製品評価に及ぼす影響
 
ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割
ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割
ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割
 
カスタムリスト添付ファイル Power Apps をそえて
カスタムリスト添付ファイル Power Apps をそえてカスタムリスト添付ファイル Power Apps をそえて
カスタムリスト添付ファイル Power Apps をそえて
 
パターン・ランゲージ入門講座(Pattern Language Innovators Summit)
パターン・ランゲージ入門講座(Pattern Language Innovators Summit)パターン・ランゲージ入門講座(Pattern Language Innovators Summit)
パターン・ランゲージ入門講座(Pattern Language Innovators Summit)
 

Ähnlich wie State Management & Unidirectional Data Flow

No Static: IA for Dynamic Information Environments
No Static: IA for Dynamic Information EnvironmentsNo Static: IA for Dynamic Information Environments
No Static: IA for Dynamic Information EnvironmentsDesign for Context
 
Uxdevsummit - Microservices the modern it stack- trends of tomorrow
Uxdevsummit - Microservices the modern it stack- trends of tomorrowUxdevsummit - Microservices the modern it stack- trends of tomorrow
Uxdevsummit - Microservices the modern it stack- trends of tomorrowJonah Kowall
 
Presentación Marcos Grilanda /Amazon Web Services - eCommerce Day Santiago 2017
Presentación Marcos Grilanda /Amazon Web Services - eCommerce Day Santiago 2017Presentación Marcos Grilanda /Amazon Web Services - eCommerce Day Santiago 2017
Presentación Marcos Grilanda /Amazon Web Services - eCommerce Day Santiago 2017eCommerce Institute
 
Technology Trends 2014 and Beyond
Technology Trends 2014 and BeyondTechnology Trends 2014 and Beyond
Technology Trends 2014 and BeyondIMC Institute
 
Making Open Data Useful: Citygram
Making Open Data Useful: CitygramMaking Open Data Useful: Citygram
Making Open Data Useful: CitygramCode for America
 
NUS-ISS Learning Day 2018-Painting Today's digital landscape
NUS-ISS Learning Day 2018-Painting Today's digital landscapeNUS-ISS Learning Day 2018-Painting Today's digital landscape
NUS-ISS Learning Day 2018-Painting Today's digital landscapeNUS-ISS
 
Cloud Trends for Government
Cloud Trends for GovernmentCloud Trends for Government
Cloud Trends for GovernmentDustin Haisler
 
Delivering Self-Service Analytics using Big Data and Data Virtualization on t...
Delivering Self-Service Analytics using Big Data and Data Virtualization on t...Delivering Self-Service Analytics using Big Data and Data Virtualization on t...
Delivering Self-Service Analytics using Big Data and Data Virtualization on t...Denodo
 
The Secure Business in the Digital Age - 27th September 2017
The Secure Business in the Digital Age - 27th September 2017The Secure Business in the Digital Age - 27th September 2017
The Secure Business in the Digital Age - 27th September 2017Exponential_e
 
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4j
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4jAI, ML and Graph Algorithms: Real Life Use Cases with Neo4j
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4jIvan Zoratti
 
Summary of Digital Information from Understanding Context
Summary of Digital Information from Understanding ContextSummary of Digital Information from Understanding Context
Summary of Digital Information from Understanding ContextRoy Kim
 
Nubeliu Presentation in Peru v2
Nubeliu Presentation in Peru v2Nubeliu Presentation in Peru v2
Nubeliu Presentation in Peru v2Alex Hübner
 
Better Software is Better than Worse Software - Michael Coté
Better Software is Better than Worse Software - Michael CotéBetter Software is Better than Worse Software - Michael Coté
Better Software is Better than Worse Software - Michael CotéVMware Tanzu
 
GraphConnect Europe 2016 - IoT - where do Graphs fit with Business Requiremen...
GraphConnect Europe 2016 - IoT - where do Graphs fit with Business Requiremen...GraphConnect Europe 2016 - IoT - where do Graphs fit with Business Requiremen...
GraphConnect Europe 2016 - IoT - where do Graphs fit with Business Requiremen...Neo4j
 
TCO: An Achilles Heel of Hand-Built Data Warehouses
TCO: An Achilles Heel of Hand-Built Data WarehousesTCO: An Achilles Heel of Hand-Built Data Warehouses
TCO: An Achilles Heel of Hand-Built Data WarehousesKalido
 
Mobility and the Real-Time Enterprise
Mobility and the Real-Time EnterpriseMobility and the Real-Time Enterprise
Mobility and the Real-Time EnterpriseAnyPresence
 
SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?Nicolas Georgeault
 
Keen on the Small Screen: The Power of Mobile for Candidate Experience | Tale...
Keen on the Small Screen: The Power of Mobile for Candidate Experience | Tale...Keen on the Small Screen: The Power of Mobile for Candidate Experience | Tale...
Keen on the Small Screen: The Power of Mobile for Candidate Experience | Tale...LinkedIn Talent Solutions
 
Mobile, Philip Nyborg
Mobile, Philip NyborgMobile, Philip Nyborg
Mobile, Philip NyborgIBM Danmark
 
Planning for a Digital Future
Planning for a Digital FuturePlanning for a Digital Future
Planning for a Digital FutureNETSCOUT
 

Ähnlich wie State Management & Unidirectional Data Flow (20)

No Static: IA for Dynamic Information Environments
No Static: IA for Dynamic Information EnvironmentsNo Static: IA for Dynamic Information Environments
No Static: IA for Dynamic Information Environments
 
Uxdevsummit - Microservices the modern it stack- trends of tomorrow
Uxdevsummit - Microservices the modern it stack- trends of tomorrowUxdevsummit - Microservices the modern it stack- trends of tomorrow
Uxdevsummit - Microservices the modern it stack- trends of tomorrow
 
Presentación Marcos Grilanda /Amazon Web Services - eCommerce Day Santiago 2017
Presentación Marcos Grilanda /Amazon Web Services - eCommerce Day Santiago 2017Presentación Marcos Grilanda /Amazon Web Services - eCommerce Day Santiago 2017
Presentación Marcos Grilanda /Amazon Web Services - eCommerce Day Santiago 2017
 
Technology Trends 2014 and Beyond
Technology Trends 2014 and BeyondTechnology Trends 2014 and Beyond
Technology Trends 2014 and Beyond
 
Making Open Data Useful: Citygram
Making Open Data Useful: CitygramMaking Open Data Useful: Citygram
Making Open Data Useful: Citygram
 
NUS-ISS Learning Day 2018-Painting Today's digital landscape
NUS-ISS Learning Day 2018-Painting Today's digital landscapeNUS-ISS Learning Day 2018-Painting Today's digital landscape
NUS-ISS Learning Day 2018-Painting Today's digital landscape
 
Cloud Trends for Government
Cloud Trends for GovernmentCloud Trends for Government
Cloud Trends for Government
 
Delivering Self-Service Analytics using Big Data and Data Virtualization on t...
Delivering Self-Service Analytics using Big Data and Data Virtualization on t...Delivering Self-Service Analytics using Big Data and Data Virtualization on t...
Delivering Self-Service Analytics using Big Data and Data Virtualization on t...
 
The Secure Business in the Digital Age - 27th September 2017
The Secure Business in the Digital Age - 27th September 2017The Secure Business in the Digital Age - 27th September 2017
The Secure Business in the Digital Age - 27th September 2017
 
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4j
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4jAI, ML and Graph Algorithms: Real Life Use Cases with Neo4j
AI, ML and Graph Algorithms: Real Life Use Cases with Neo4j
 
Summary of Digital Information from Understanding Context
Summary of Digital Information from Understanding ContextSummary of Digital Information from Understanding Context
Summary of Digital Information from Understanding Context
 
Nubeliu Presentation in Peru v2
Nubeliu Presentation in Peru v2Nubeliu Presentation in Peru v2
Nubeliu Presentation in Peru v2
 
Better Software is Better than Worse Software - Michael Coté
Better Software is Better than Worse Software - Michael CotéBetter Software is Better than Worse Software - Michael Coté
Better Software is Better than Worse Software - Michael Coté
 
GraphConnect Europe 2016 - IoT - where do Graphs fit with Business Requiremen...
GraphConnect Europe 2016 - IoT - where do Graphs fit with Business Requiremen...GraphConnect Europe 2016 - IoT - where do Graphs fit with Business Requiremen...
GraphConnect Europe 2016 - IoT - where do Graphs fit with Business Requiremen...
 
TCO: An Achilles Heel of Hand-Built Data Warehouses
TCO: An Achilles Heel of Hand-Built Data WarehousesTCO: An Achilles Heel of Hand-Built Data Warehouses
TCO: An Achilles Heel of Hand-Built Data Warehouses
 
Mobility and the Real-Time Enterprise
Mobility and the Real-Time EnterpriseMobility and the Real-Time Enterprise
Mobility and the Real-Time Enterprise
 
SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?SPSNYC2019 - What is Common Data Model and how to use it?
SPSNYC2019 - What is Common Data Model and how to use it?
 
Keen on the Small Screen: The Power of Mobile for Candidate Experience | Tale...
Keen on the Small Screen: The Power of Mobile for Candidate Experience | Tale...Keen on the Small Screen: The Power of Mobile for Candidate Experience | Tale...
Keen on the Small Screen: The Power of Mobile for Candidate Experience | Tale...
 
Mobile, Philip Nyborg
Mobile, Philip NyborgMobile, Philip Nyborg
Mobile, Philip Nyborg
 
Planning for a Digital Future
Planning for a Digital FuturePlanning for a Digital Future
Planning for a Digital Future
 

Mehr von Nikolas Burk

Next-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and PrismaNext-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and PrismaNikolas Burk
 
Code-first GraphQL Server Development with Prisma
Code-first  GraphQL Server Development with PrismaCode-first  GraphQL Server Development with Prisma
Code-first GraphQL Server Development with PrismaNikolas Burk
 
GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchNikolas Burk
 
GraphQL Schema Stitching with Prisma & Contentful
GraphQL Schema Stitching with Prisma & ContentfulGraphQL Schema Stitching with Prisma & Contentful
GraphQL Schema Stitching with Prisma & ContentfulNikolas Burk
 
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Managing GraphQL servers  with AWS Fargate & Prisma CloudManaging GraphQL servers  with AWS Fargate & Prisma Cloud
Managing GraphQL servers with AWS Fargate & Prisma CloudNikolas Burk
 
Building GraphQL Servers with Node.JS & Prisma
Building GraphQL Servers with Node.JS & PrismaBuilding GraphQL Servers with Node.JS & Prisma
Building GraphQL Servers with Node.JS & PrismaNikolas Burk
 
The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018Nikolas Burk
 
Building Serverless GraphQL Backends
Building Serverless GraphQL BackendsBuilding Serverless GraphQL Backends
Building Serverless GraphQL BackendsNikolas Burk
 
GraphQL Subscriptions
GraphQL SubscriptionsGraphQL Subscriptions
GraphQL SubscriptionsNikolas Burk
 
The Serverless GraphQL Backend Architecture
The Serverless GraphQL Backend ArchitectureThe Serverless GraphQL Backend Architecture
The Serverless GraphQL Backend ArchitectureNikolas Burk
 
Diving into GraphQL, React & Apollo
Diving into GraphQL, React & ApolloDiving into GraphQL, React & Apollo
Diving into GraphQL, React & ApolloNikolas Burk
 
Authentication, Authorization & Error Handling with GraphQL
Authentication, Authorization & Error Handling with GraphQLAuthentication, Authorization & Error Handling with GraphQL
Authentication, Authorization & Error Handling with GraphQLNikolas Burk
 
Getting Started with Relay Modern
Getting Started with Relay ModernGetting Started with Relay Modern
Getting Started with Relay ModernNikolas Burk
 
Building a Realtime Chat with React Native (Expo) & GraphQL Subscriptions
Building a Realtime Chat with React Native (Expo) & GraphQL Subscriptions Building a Realtime Chat with React Native (Expo) & GraphQL Subscriptions
Building a Realtime Chat with React Native (Expo) & GraphQL Subscriptions Nikolas Burk
 
Building a Realtime Chat with React & GraphQL Subscriptions
Building a Realtime Chat with React & GraphQL Subscriptions Building a Realtime Chat with React & GraphQL Subscriptions
Building a Realtime Chat with React & GraphQL Subscriptions Nikolas Burk
 
REST in Peace - Using GraphQL with Apollo on iOS
REST in Peace - Using GraphQL with Apollo on iOSREST in Peace - Using GraphQL with Apollo on iOS
REST in Peace - Using GraphQL with Apollo on iOSNikolas Burk
 

Mehr von Nikolas Burk (17)

Next-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and PrismaNext-generation API Development with GraphQL and Prisma
Next-generation API Development with GraphQL and Prisma
 
Code-first GraphQL Server Development with Prisma
Code-first  GraphQL Server Development with PrismaCode-first  GraphQL Server Development with Prisma
Code-first GraphQL Server Development with Prisma
 
GraphQL & Prisma from Scratch
GraphQL & Prisma from ScratchGraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch
 
GraphQL Schema Stitching with Prisma & Contentful
GraphQL Schema Stitching with Prisma & ContentfulGraphQL Schema Stitching with Prisma & Contentful
GraphQL Schema Stitching with Prisma & Contentful
 
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Managing GraphQL servers  with AWS Fargate & Prisma CloudManaging GraphQL servers  with AWS Fargate & Prisma Cloud
Managing GraphQL servers with AWS Fargate & Prisma Cloud
 
Building GraphQL Servers with Node.JS & Prisma
Building GraphQL Servers with Node.JS & PrismaBuilding GraphQL Servers with Node.JS & Prisma
Building GraphQL Servers with Node.JS & Prisma
 
The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018The GraphQL Ecosystem in 2018
The GraphQL Ecosystem in 2018
 
React & GraphQL
React & GraphQLReact & GraphQL
React & GraphQL
 
Building Serverless GraphQL Backends
Building Serverless GraphQL BackendsBuilding Serverless GraphQL Backends
Building Serverless GraphQL Backends
 
GraphQL Subscriptions
GraphQL SubscriptionsGraphQL Subscriptions
GraphQL Subscriptions
 
The Serverless GraphQL Backend Architecture
The Serverless GraphQL Backend ArchitectureThe Serverless GraphQL Backend Architecture
The Serverless GraphQL Backend Architecture
 
Diving into GraphQL, React & Apollo
Diving into GraphQL, React & ApolloDiving into GraphQL, React & Apollo
Diving into GraphQL, React & Apollo
 
Authentication, Authorization & Error Handling with GraphQL
Authentication, Authorization & Error Handling with GraphQLAuthentication, Authorization & Error Handling with GraphQL
Authentication, Authorization & Error Handling with GraphQL
 
Getting Started with Relay Modern
Getting Started with Relay ModernGetting Started with Relay Modern
Getting Started with Relay Modern
 
Building a Realtime Chat with React Native (Expo) & GraphQL Subscriptions
Building a Realtime Chat with React Native (Expo) & GraphQL Subscriptions Building a Realtime Chat with React Native (Expo) & GraphQL Subscriptions
Building a Realtime Chat with React Native (Expo) & GraphQL Subscriptions
 
Building a Realtime Chat with React & GraphQL Subscriptions
Building a Realtime Chat with React & GraphQL Subscriptions Building a Realtime Chat with React & GraphQL Subscriptions
Building a Realtime Chat with React & GraphQL Subscriptions
 
REST in Peace - Using GraphQL with Apollo on iOS
REST in Peace - Using GraphQL with Apollo on iOSREST in Peace - Using GraphQL with Apollo on iOS
REST in Peace - Using GraphQL with Apollo on iOS
 

Kürzlich hochgeladen

Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 

Kürzlich hochgeladen (20)

Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 

State Management & Unidirectional Data Flow

  • 1. @nikolasburkState Management & Unidirectional Data Flow State Management & Unidirectional Data Flow “Where is truth in your application?” Andy Matuschak, WWDC 2014
  • 2. Nikolas Burk @nikolasburk • Developer at Graphcool • Experienced with iOS • Passionate about programming paradigms and architecture
  • 3. 1. State Management 2. Unidirectional Data Flow & ReSwift @nikolasburkState Management & Unidirectional Data Flow Goals 🎯
  • 4. State Management …and why it matters to you
  • 5. @nikolasburkState Management & Unidirectional Data Flow
  • 6. @nikolasburkState Management & Unidirectional Data Flow An Application is more than the Happy Path “In the context of software or information modeling, a happy path is a default scenario featuring no exceptional or error conditions.” Wikipedia 😏
  • 7. @nikolasburkState Management & Unidirectional Data Flow Decision process for Slack Notifications
  • 8. The application state represents the information that is kept in memory of a running application and is the basis for the generation of a user interface. Application State? 🤔 @nikolasburkState Management & Unidirectional Data Flow
  • 9. The application state represents the information that is kept in memory of a running application and is the basis for the generation of a user interface. Application State? 🤔 @nikolasburkState Management & Unidirectional Data Flow
  • 10. The application state represents the information that is kept in memory of a running application and is the basis for the generation of a user interface. Application State? 🤔 @nikolasburkState Management & Unidirectional Data Flow
  • 11. @nikolasburkState Management & Unidirectional Data Flow The main responsibility of an app is to transform an application state into a user interface. (AppState) -> UI
  • 12. Example: Conference Planner App 🗓 @nikolasburkState Management & Unidirectional Data Flow struct Conference { let name: String let city: String let year: String var attending: Bool }
  • 13. Application State? 🤔 @nikolasburkState Management & Unidirectional Data Flow conferences = [ Conference( name: "AppDevcon", city: "Amsterdam", year: "2017", attending: true ), Conference( name: "UIKonf", city: "Berlin", year: "2017", attending: false ), Conference( name: "WWDC", city: "San Jose", year: "2017", attending: true ) ]
  • 14. Application State? 🤔 @nikolasburkState Management & Unidirectional Data Flow conferences = [ Conference( name: "AppDevcon", city: "Amsterdam", year: "2017", attending: true ), Conference( name: "UIKonf", city: "Berlin", year: "2017", attending: false ), Conference( name: "WWDC", city: "San Jose", year: "2017", attending: true ) ] selectedIndex = 0
  • 15. Application State? 🤔 @nikolasburkState Management & Unidirectional Data Flow conferences = [ Conference( name: "AppDevcon", city: "Amsterdam", year: "2017", attending: true ), Conference( name: "UIKonf", city: "Berlin", year: "2017", attending: false ), Conference( name: "WWDC", city: "San Jose", year: "2017", attending: true ) ] selectedIndex = nil
  • 16. @nikolasburkState Management & Unidirectional Data Flow 1. Where should the state live? 2. Who is allowed to change the state? 3. How does the state get changed? 3 Golden Questions of State Management 👑 An architectural pattern should be able to answer these questions!
  • 17. @nikolasburkState Management & Unidirectional Data Flow Model View Controller
  • 18. @nikolasburkState Management & Unidirectional Data Flow Where should state live? 1 👑
  • 19. @nikolasburkState Management & Unidirectional Data Flow Who is allowed to change the state? 2 👑
  • 20. @nikolasburkState Management & Unidirectional Data Flow How does the state get changed? KVO & Property Observers Delegates Callbacks NSNotificationCenter Target-Action 3 👑
  • 21. @nikolasburkState Management & Unidirectional Data Flow UIViewController What’s wrong with MVC? Persistence Networking Navigation Domain Logic User Interface Concurrency
  • 22. @nikolasburkState Management & Unidirectional Data Flow State Management is hard and MVC is not a solution, thanks Apple 😑
  • 23. Unidirectional Data Flow … and controlling your application state with ReSwift
  • 24. @nikolasburkState Management & Unidirectional Data Flow • 3 Principles • Single source of truth • State is read-only • Changes with pure functions http://redux.js.org/docs/introduction/ThreePrinciples.html
  • 25. @nikolasburkState Management & Unidirectional Data Flow Main Concepts Store: … manages the application state … informs subscribers about changes Actions: … describe an intent to change the state Reducer: … pure functions that generate a new application state based on actions
  • 26. Example Flow @nikolasburkState Management & Unidirectional Data Flow
  • 27. Application State (Old) AppDevcon UIKonf WWDC Reducer add Swift Summit to list and return new application state Action “Swift Summit” “San Francisco” “2017” Application State (New) AppDevcon UIKonf WWDC Swift Summit
  • 28. @nikolasburkState Management & Unidirectional Data Flow Helpful Resources 📚 • Unidirectional Data Flow in Swift: An Alternative to Massive View Controllers (Video) (https://realm.io/news/benji-encz- unidirectional-data-flow-swift/) • Real World Flux Architecture on iOS (http://blog.benjamin- encz.de/post/real-world-flux-ios/) • Redux Documentation (http://redux.js.org/) • Advanced iOS Application Architecture and Patterns, Andy Matuschak WWDC 2014 (Video) (http://asciiwwdc.com/2014/ sessions/229)
  • 30.