Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
MVVM vs MVP
Search
Aydar
October 10, 2017
Programming
1
270
MVVM vs MVP
Presentation for the lightning talk on spikeweek at Freeletics
Aydar
October 10, 2017
Tweet
Share
More Decks by Aydar
See All by Aydar
The Realities of A/B Testing
aydarin
0
77
Development on Kotlin/Native and Swift
aydarin
1
110
AppCode under the hood
aydarin
1
270
Bridging the gap between Kotlin and Swift
aydarin
0
120
A look into AB testing
aydarin
0
77
Exploring MVVM-C
aydarin
0
160
Coordinate your app
aydarin
1
92
Localization.pdf
aydarin
0
52
image_optimization.pdf
aydarin
0
66
Other Decks in Programming
See All in Programming
Google Opalで使える37のライブラリ
mickey_kubo
3
170
AkarengaLT vol.38
hashimoto_kei
1
130
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
170
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.3k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
440
Dive into Triton Internals
appleparan
0
350
CSC305 Lecture 11
javiergs
PRO
0
320
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
500
モテるデスク環境
mozumasu
3
1.4k
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
180
ドメイン駆動設計のエッセンス
masuda220
PRO
15
6.9k
AI Agent 時代的開發者生存指南
eddie
4
2.2k
Featured
See All Featured
Music & Morning Musume
bryan
46
6.9k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
GitHub's CSS Performance
jonrohan
1032
470k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
How GitHub (no longer) Works
holman
315
140k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
Transcript
MVVM-C vs MVP Aydar Mukhametzyanov Dmytro Khmelenko
None
None
View Controller Model Model-View-Controller
Layout Activity View Controller Model Model-View-Controller
View Controller Model Model-View-Controller
UIViewController Model View Controller Model-View-Controller
Problems with MVC Activity/UIViewController is a “God” class Business logic
is mixed with UI Hard to reuse Hard to implement tests
Solution Model-View-Presenter Model-View-ViewModel (+Coordinator)
View Model (Interactor) Activity Layout Presenter MVP
Solution Model-View-Presenter Model-View-ViewModel (+Coordinator)
MVVM UIViewController Model View Controller
Model ViewModel View UIViewController MVVM
Model ViewModel View UIViewController UIView MVVM Navigation?
MVVM stack Model ViewModel View Coordinator MVVM-C
MVVM stack Coordinator MVVM stack MVVM stack MVVM-C
MVVM stack MVVM stack MVVM stack MVVM stack Coordinator Coordinator
MVVM-C
View Model (Interactor) Activity Layout Presenter MVVM vs MVP Model
ViewModel View UIViewController UIView
• Provides data to Presenter/ViewModel • Processes data (networking, persistence)
Model (Interactor) Responsibilities
Responsibilities • Draws UI with provided data • Notifies Presenter/ViewModel
about user actions View
• Handles user actions from View • Gets data from
Model • Updates data in Model • Business logic • Provides updated/processed data to View Presenter/ViewModel Responsibilities ——————————————————— • Communicates with Coordinator
• Handle navigation • Build the MVVM stacks Coordinator Responsibilities
Same thing, different names?
Bindings View ViewModel Owns Observes by Reactive approach
Simulate bindings View ViewModel Owns Notifies To be continued… …with
Reactive approach?
Business logic is decoupled from UI Easy to maintain Easy
to test Easy to reuse components MVP/MVVM-C advantages
Thank you! Questions