Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
MVVM vs. MVP
Search
Dmytro Khmelenko
October 10, 2017
Programming
62
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
MVVM vs. MVP
Comparison architectures MVVM for iOS and MVP for Android
Dmytro Khmelenko
October 10, 2017
Transcript
27 slides
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
More Decks by Dmytro Khmelenko
See All by Dmytro Khmelenko
Securing High-Risk Django Applications
dkhmelenko
0
12
Securing High-Risk Django Applications: Lessons from the Payment Domain
dkhmelenko
0
95
Securing Python Web Applications
dkhmelenko
0
46
Best of login experience
dkhmelenko
0
130
Best of sign in experience @ Droidcon Lisbon
dkhmelenko
0
140
Red or Green? Let us test
dkhmelenko
0
53
A journey to smaller APK size
dkhmelenko
1
130
A journey to smaller apk size
dkhmelenko
0
80
How Git helps us with localization
dkhmelenko
0
110
Other Decks in Programming
See All in Programming
Distance field of Julia set
kinakomoti321
0
330
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
350
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
180
Spec-driven Development with AI
simas
PRO
0
2.3k
疎結合とは何か?ソフトウェア設計における結合バランスについて考える #phpcon_niigata
kajitack
2
400
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
260
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
240
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
300
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
180
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
320
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
3
12k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
Design in an AI World
tapps
1
390
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
310
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
570
How to build a perfect <img>
jonoalderson
1
6.2k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
360
Practical Orchestrator
shlominoach
192
12k
Context Engineering - Making Every Token Count
addyosmani
9
1.3k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.8k
Thoughts on Productivity
jonyablonski
76
5.5k
Chasing Engaging Ingredients in Design
codingconduct
0
400