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
240
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
64
Development on Kotlin/Native and Swift
aydarin
1
85
AppCode under the hood
aydarin
1
220
Bridging the gap between Kotlin and Swift
aydarin
0
110
A look into AB testing
aydarin
0
70
Exploring MVVM-C
aydarin
0
140
Coordinate your app
aydarin
1
71
Localization.pdf
aydarin
0
35
image_optimization.pdf
aydarin
0
64
Other Decks in Programming
See All in Programming
Webフレームワークとともに利用するWeb components / JSConf.jp おかわり
spring_raining
1
130
CDKを使ったPagerDuty連携インフラのテンプレート化
shibuya_shogo
0
120
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
230
推しメソッドsource_locationのしくみを探る - はじめてRubyのコードを読んでみた
nobu09
2
360
Swift Testingのモチベを上げたい
stoticdev
2
200
もう僕は OpenAPI を書きたくない
sgash708
6
1.9k
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
260
Domain-Driven Design (Tutorial)
hschwentner
13
22k
kintone開発を効率化するためにチームで試した施策とその結果を大放出!
oguemon
0
340
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
270
読まないコードリーディング術
hisaju
0
120
Better Code Design in PHP
afilina
0
180
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
67
11k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
4 Signs Your Business is Dying
shpigford
183
22k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
440
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
134
33k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
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