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
220
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
53
Development on Kotlin/Native and Swift
aydarin
1
80
AppCode under the hood
aydarin
1
170
Bridging the gap between Kotlin and Swift
aydarin
0
95
A look into AB testing
aydarin
0
65
Exploring MVVM-C
aydarin
0
120
Coordinate your app
aydarin
1
60
Localization.pdf
aydarin
0
33
image_optimization.pdf
aydarin
0
62
Other Decks in Programming
See All in Programming
Micro Frontends for Java Microservices - dev2next 2024
mraible
PRO
0
210
Новый уровень ML-персонализации Lamoda: Как мы усилили ее в каталоге и перенесли на другие продукты
lamodatech
0
240
Cloud Adoption Frameworkにみる組織とクラウド導入戦略(縮小版)
tomokusaba
1
230
実務未経験からいち早く戦力化するための新人エンジニア育成術 ~ 具体的な方法と育成する側の心得 ~
juri_matsuda
0
120
ML-прайсинг_на_Lamoda__вошли_и_вышли__приключение_на_20_минут__Слава_Цыганков.pdf
lamodatech
0
240
WEBアプリケーションにおけるAWS Lambdaを用いた大規模な非同期処理の実践
delhi09
PRO
7
4.4k
色んなオートローダーを覗き見る #phpcon_okinawa
o0h
PRO
5
410
Unlocking Python's Core Magic
leew
0
130
データフレームライブラリ徹底比較
daikikatsuragawa
2
110
実践Dash - 手を抜きながら本気で作るデータApplicationの基本と応用 / Dash for Python and Baseball
shinyorke
2
640
デバッグの話 / Debugging for Beginners
kaityo256
PRO
8
640
もう実家に手頃な情シス娘は不要!Bedrockでもう一人の娘を作る
komakichi
0
120
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Unsuck your backbone
ammeep
668
57k
A Tale of Four Properties
chriscoyier
156
22k
Gamification - CAS2011
davidbonilla
80
5k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
How GitHub (no longer) Works
holman
311
140k
Making Projects Easy
brettharned
115
5.9k
Docker and Python
trallard
40
3k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Bash Introduction
62gerente
608
210k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.5k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
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