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
200
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
50
Development on Kotlin/Native and Swift
aydarin
1
79
AppCode under the hood
aydarin
1
130
Bridging the gap between Kotlin and Swift
aydarin
0
82
A look into AB testing
aydarin
0
65
Exploring MVVM-C
aydarin
0
97
Coordinate your app
aydarin
1
53
Localization.pdf
aydarin
0
29
image_optimization.pdf
aydarin
0
46
Other Decks in Programming
See All in Programming
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
820
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.4k
Ruby Pattern Matching
bkuhlmann
0
930
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
340
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
ONE WEDGE_company_guide
1wedge_one
0
490
Java 22 Overview
kishida
1
180
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
150
2 週間で Twitter Bot を作ってみた
contour_gara
0
570
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
260
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
190
[技育CAMPアカデミア]アイディアを形に!【超入門】スマホアプリ開発〜リリースまでの流れをご紹介
teamlab
PRO
0
380
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
237
11k
Designing for humans not robots
tammielis
248
25k
A Philosophy of Restraint
colly
197
16k
What's new in Ruby 2.0
geeforr
337
31k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
Git: the NoSQL Database
bkeepers
PRO
422
63k
Design by the Numbers
sachag
274
18k
Building a Scalable Design System with Sketch
lauravandoore
456
32k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
The Cult of Friendly URLs
andyhume
74
5.7k
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