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
210
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
50
Development on Kotlin/Native and Swift
aydarin
1
80
AppCode under the hood
aydarin
1
150
Bridging the gap between Kotlin and Swift
aydarin
0
89
A look into AB testing
aydarin
0
65
Exploring MVVM-C
aydarin
0
110
Coordinate your app
aydarin
1
60
Localization.pdf
aydarin
0
30
image_optimization.pdf
aydarin
0
62
Other Decks in Programming
See All in Programming
AWSでゲームサーバーを運用! Amazon GameLiftのお話
iriikeita
0
200
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
CSC307 Lecture 09
javiergs
PRO
1
500
Rust.Nagoya #1
codemountains
0
170
How to use Macrobenchmark
veronikapj
0
160
ドメイン駆動設計の実践
masuda220
PRO
17
5.1k
Play Billing Library 7.0.0 変更点まとめ@potatotips#88
kako351
0
160
SDCon2024: Enabling DevOps and Team Topologies thru architecture: architecting for fast flow
cer
PRO
0
780
Prompt FlowによるLLMアプリケーション開発
yuto2000
1
1k
日付と正規化
megmogmog1965
0
140
I/O Extended Android in Korea 2024 ~ Whats new in Android development tools
pluu
0
250
企業向け生成AIアプリの 開発から得られた知見
takaakikakei
0
310
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
93
13k
The Invisible Side of Design
smashingmag
294
50k
Designing with Data
zakiwarfel
96
5k
The Straight Up "How To Draw Better" Workshop
denniskardys
229
130k
Embracing the Ebb and Flow
colly
81
4.3k
Building Applications with DynamoDB
mza
89
5.8k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Raft: Consensus for Rubyists
vanstee
134
6.5k
We Have a Design System, Now What?
morganepeng
46
7k
RailsConf 2023
tenderlove
16
720
Why Our Code Smells
bkeepers
PRO
332
56k
Unsuck your backbone
ammeep
666
57k
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