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
110
Best of sign in experience @ Droidcon Lisbon
dkhmelenko
0
100
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
63
How Git helps us with localization
dkhmelenko
0
100
Dagger.Android module
dkhmelenko
0
69
Unit testing
dkhmelenko
0
47
Other Decks in Programming
See All in Programming
GitHubとGitLabとAWS CodePipelineでCI/CDを組み比べてみた
satoshi256kbyte
4
220
Laravel Boost 超入門
fire_arlo
3
210
testingを眺める
matumoto
1
140
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
140
How Android Uses Data Structures Behind The Scenes
l2hyunwoo
0
430
AWS発のAIエディタKiroを使ってみた
iriikeita
1
180
Deep Dive into Kotlin Flow
jmatsu
1
320
旅行プランAIエージェント開発の裏側
ippo012
2
900
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
430
機能追加とリーダー業務の類似性
rinchoku
2
1.3k
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.7k
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
310
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
Side Projects
sachag
455
43k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
KATA
mclloyd
32
14k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Facilitating Awesome Meetings
lara
55
6.5k
Docker and Python
trallard
45
3.6k
How STYLIGHT went responsive
nonsquared
100
5.8k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
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