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
300
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
MVVM vs MVP
Presentation for the lightning talk on spikeweek at Freeletics
Aydar
October 10, 2017
More Decks by Aydar
See All by Aydar
The Realities of A/B Testing
aydarin
0
110
Development on Kotlin/Native and Swift
aydarin
1
130
AppCode under the hood
aydarin
1
360
Bridging the gap between Kotlin and Swift
aydarin
0
140
A look into AB testing
aydarin
0
95
Exploring MVVM-C
aydarin
0
180
Coordinate your app
aydarin
1
110
Localization.pdf
aydarin
0
67
image_optimization.pdf
aydarin
0
71
Other Decks in Programming
See All in Programming
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
480
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
120
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
500
Haskell/Servantを通してWebミドルウェアを捉え直す
pizzacat83
1
600
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
110
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
1
240
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
400
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
220
Prismを使った型安全な暗号化_関数型まつり2026
_fhhmm
0
150
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
160
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
540
Featured
See All Featured
Accessibility Awareness
sabderemane
1
160
Believing is Seeing
oripsolob
1
170
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
460
RailsConf 2023
tenderlove
30
1.5k
Rails Girls Zürich Keynote
gr2m
96
14k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
370
The Cost Of JavaScript in 2023
addyosmani
55
10k
We Are The Robots
honzajavorek
0
280
The Invisible Side of Design
smashingmag
301
52k
The SEO identity crisis: Don't let AI make you average
varn
0
520
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
490
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