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
230
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
59
Development on Kotlin/Native and Swift
aydarin
1
82
AppCode under the hood
aydarin
1
190
Bridging the gap between Kotlin and Swift
aydarin
0
100
A look into AB testing
aydarin
0
67
Exploring MVVM-C
aydarin
0
120
Coordinate your app
aydarin
1
64
Localization.pdf
aydarin
0
34
image_optimization.pdf
aydarin
0
63
Other Decks in Programming
See All in Programming
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
190
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
530
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Italy
prof18
0
150
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
770
Full stack testing :: basic to basic
up1
1
930
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
Featured
See All Featured
It's Worth the Effort
3n
183
28k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
For a Future-Friendly Web
brad_frost
175
9.4k
Making Projects Easy
brettharned
116
5.9k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
The Invisible Side of Design
smashingmag
298
50k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
How STYLIGHT went responsive
nonsquared
95
5.2k
Optimising Largest Contentful Paint
csswizardry
33
3k
GitHub's CSS Performance
jonrohan
1030
460k
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