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
Dmytro Khmelenko
October 10, 2017
Programming
0
50
MVVM vs. MVP
Comparison architectures MVVM for iOS and MVP for Android
Dmytro Khmelenko
October 10, 2017
Tweet
Share
More Decks by Dmytro Khmelenko
See All by Dmytro Khmelenko
Securing Python Web Applications
dkhmelenko
0
28
Best of login experience
dkhmelenko
0
120
Best of sign in experience @ Droidcon Lisbon
dkhmelenko
0
110
Red or Green? Let us test
dkhmelenko
0
44
A journey to smaller APK size
dkhmelenko
1
120
A journey to smaller apk size
dkhmelenko
0
65
How Git helps us with localization
dkhmelenko
0
100
Dagger.Android module
dkhmelenko
0
71
Unit testing
dkhmelenko
0
47
Other Decks in Programming
See All in Programming
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
170
GC25 Recap: The Code You Reviewed is Not the Code You Built / #newt_gophercon_tour
mazrean
0
140
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
840
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
440
Reactive Thinking with Signals and the Resource API
manfredsteyer
PRO
0
120
Swift Concurrency 年表クイズ
omochi
3
210
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
260
Google Opalで使える37のライブラリ
mickey_kubo
3
180
Webサーバーサイド言語としてのRustについて
kouyuume
1
5k
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
120
Leading Effective Engineering Teams in the AI Era
addyosmani
7
680
三者三様 宣言的UI
kkagurazaka
0
320
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
174
15k
Six Lessons from altMBA
skipperchong
29
4k
4 Signs Your Business is Dying
shpigford
186
22k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Done Done
chrislema
186
16k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
680
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Balancing Empowerment & Direction
lara
5
710
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