SlideShare a Scribd company logo
CHOOSING THE ARCHITECTURE
FROM MV(X) TO VIP(ER)
1
ABOUT US
Giovane Berny Possebon
Mobile Developer
giovane.possebon@ilegra.com
Lucas Dutra Fonseca
Mobile Developer
lucas.fonseca@ilegra.com
WHY CARE
ABOUT IT?
3
"BECAUSE IF YOU DON’T, ONE DAY, DEBUGGING A
HUGE CLASS WITH DOZENS DIFFERENT THINGS,
YOU’LL FIND YOURSELF BEING UNABLE TO FIND
AND FIX ANY BUGS IN YOUR CLASS."
Someone who’s right
WHY CARE ABOUT IT? 4
WHY CARE ABOUT IT?
REASONS
▸ This class is the UIViewController subclass.
▸ Your data is stored directly in the UIViewController
▸ Your UIViews do almost nothing
▸ The Model is a dumb data structure
▸ Your Unit Tests cover nothing
5
WHY CARE ABOUT IT?
SO WHAT A GOOD ARCHITECTURE SHOULD HAVE?
▸ Balanced distribution of responsibilities among entities
with strict roles.
▸ Testability usually comes from the first feature.
▸ Ease of use and a low maintenance cost.
6
THEN SHOW ME
THESE ARCHITECTURES!
7
THEN SHOW ME THESE ARCHITECTURES!
RENOWNED ARCHITECTURES
▸ MVC
▸ MVP
▸ MVVM
▸ VIPER
▸ VIP
8
MVC
MODEL-VIEW-
CONTROLLER
9
MVC - MODEL-VIEW-CONTROLLER
HOW IT SHOULD BE
VIEW
CONTROLLER
MODEL
Updates
NotifiesSend actions
10
MVC - MODEL-VIEW-CONTROLLER
HOW IT REALLY IS
VIEW CONTROLLER MODEL
Owns and updates
Notifies
11
MVC - MODEL-VIEW-CONTROLLER
HOW IT REALLY IS
VIEW CONTROLLER MODEL
Owns and updates
Notifies
MVC
12
MVC - MODEL-VIEW-CONTROLLER
HOW IT REALLY IS
VIEW CONTROLLER MODEL
Owns and updates
Notifies
Massive View Controller
13
MVC - MODEL-VIEW-CONTROLLER
CONCLUSION
▸ Distribution of Responsibilities - View and controller tightly
coupled
▸ Testability - Only model is testable
▸ Ease of Use - Low amount of code. Everyone is familiar
with it.
14
MVP
MODEL-VIEW-PRESENTER
15
What if I told you, the UIViewController is the View.
MVP - MODEL-VIEW-PRESENTER
MVC IN THE RIGHT WAY
PASSIVE VIEW
PRESENTER
MODELUpdates
Owns and updatesOwns and send actions
Notifies
17
MVP - MODEL-VIEW-PRESENTER
MVC IN THE RIGHT WAY
PASSIVE VIEW
PRESENTER
MODELUpdates
Owns and updatesOwns and send actions
Notifies
UIViewController
UIKit independent mediator
18
MVP - MODEL-VIEW-PRESENTER
CONCLUSION
▸ Distribution of Responsibilities - Most of responsibilities divided
between the Presenter and the Model, with the pretty dumb View
▸ Testability - Good, we can test most of the business logic due to
the dumb View
▸ Ease of Use - Substantial amount of code, although idea is very
clear
19
MVVM
MODEL-VIEW-VIEWMODEL
20
MVVM - MODEL-VIEW-VIEWMODEL
THE GREATEST OF THE MV(X) KIND
VIEW
VIEWMODEL
MODELUpdates
Owns and updatesOwns and send actions
Notifies
21
MVVM - MODEL-VIEW-VIEWMODEL
CONCLUSION
▸ Distribution of Responsibilities - Similar to MVP, but View
has more responsibilities than the MVP’s
▸ Testability - View Model knows nothing about the View, this
allows us to test it easily. The View might be also tested
▸ Ease of Use - It has almost the same amount of code as the
MVP
22
VIPER
23
VIPER
THE LEGO ARCHITECTURE
VIEW
PRESENTER
ENTITY
Updates
Owns and asks for updatesOwns and send actions
Notifies INTERACTOR
ROUTER
Knows about
24
VIPER
THE LEGO ARCHITECTURE
VIEW
PRESENTER
ENTITY
Updates
Owns and asks for updatesOwns and send actions
Notifies INTERACTOR
ROUTER
Knows about
Manipulates data and
use cases
UIKit independent mediator
Former Model
25
VIPER
CONCLUSION
▸ Distribution of Responsibilities - VIPER is a champion in
distribution of responsibilities.
▸ Testability - better distribution — better testability
▸ Ease of Use - You have to write huge amount of interface
for classes with very small responsibilities.
26
VIP
CLEAN SWIFT
27
VIP
THE CLEAN ARCHITECTURE
VIEW PRESENTER
ENTITY
Updates
Process and deliver dataSend actions INTERACTOR
ROUTER
Knows about
Owns
28
VIP
THE CLEAN ARCHITECTURE
VIEW PRESENTER
ENTITY
Updates
Process and deliver dataSend actions INTERACTOR
ROUTER
Knows about
Owns
UIKit independent mediator Former Model
29
VIP
CONCLUSION
▸ Distribution of Responsibilities - VIP is as good as VIPER in
terms of distribution of responsibilities.
▸ Testability - Also comparable to VIPER
▸ Ease of Use - Great amount of classes with very small
responsibilities, but clearer than VIPER
30
CHOOSING THE ARCHITECTURE
REFERENCES
▸ https://medium.com/ios-os-x-development/ios-
architecture-patterns-ecba4c38de52
▸ http://clean-swift.com/clean-swift-ios-architecture/
31
CHOOSING THE ARCHITECTURE
CODE REPOSITORY
▸ https://github.com/lfonseca/choosing-the-architecture
32
THANKS!
Giovane Berny Possebon
Mobile Developer
giovane.possebon@ilegra.com
Lucas Dutra Fonseca
Mobile Developer
lucas.fonseca@ilegra.com
EXPERIENCES SO
FAR…
34

More Related Content

PDF
Immutable Systems in the AWS Cloud
PDF
Building Apps That Retain More Users
PDF
"Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,...
PDF
Dependence day insurgence
PDF
Why the Dark Side should use Swift and a SOLID Architecture
PDF
"Clean" Architecture
PDF
iOS Zagreb Meetup #02 - Clean architecture in iOS apps (Leonard Beus @ Five)
PDF
Jorge D. Ortiz Fuentes "Hands on Implementation of Clean Architecture for And...
Immutable Systems in the AWS Cloud
Building Apps That Retain More Users
"Architecting and testing large iOS apps: lessons from Facebook". Adam Ernst,...
Dependence day insurgence
Why the Dark Side should use Swift and a SOLID Architecture
"Clean" Architecture
iOS Zagreb Meetup #02 - Clean architecture in iOS apps (Leonard Beus @ Five)
Jorge D. Ortiz Fuentes "Hands on Implementation of Clean Architecture for And...

Viewers also liked (17)

PDF
Infinum iOS Talks #4 - Making our VIPER more reactive
PDF
Clean architecture workshop
PPTX
Importance of software architecture
PDF
Intro to iOS Application Architecture
PDF
Introduction to VIPER Architecture
PDF
iOS viper presentation
PDF
From mvc to viper
PPTX
VIPER - Design Pattern
PDF
iOS App Architecture
PDF
Rambler.iOS #5: VIPER и Swift
PPT
iOS Platform & Architecture
PDF
Building iOS App Project & Architecture
PDF
Architecting iOS Project
PPTX
iOS Coding Best Practices
PPTX
Apple iOS
PDF
Visual Design with Data
PDF
3 Things Every Sales Team Needs to Be Thinking About in 2017
Infinum iOS Talks #4 - Making our VIPER more reactive
Clean architecture workshop
Importance of software architecture
Intro to iOS Application Architecture
Introduction to VIPER Architecture
iOS viper presentation
From mvc to viper
VIPER - Design Pattern
iOS App Architecture
Rambler.iOS #5: VIPER и Swift
iOS Platform & Architecture
Building iOS App Project & Architecture
Architecting iOS Project
iOS Coding Best Practices
Apple iOS
Visual Design with Data
3 Things Every Sales Team Needs to Be Thinking About in 2017
Ad

Similar to Choosing the architecture (20)

PPTX
VIPER ( ? OR : AND) MVVM
PDF
iOS architecture patterns
PDF
Ui design patterns
PDF
Clean VIP (Clean Swift) architecture
PPTX
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
PDF
Infinum iOS Talks #2 - VIPER for everybody by Damjan Vujaklija
PDF
Common iOS Architecture: From MVC to VIPER, with Redux
PDF
Models used in iOS programming, with a focus on MVVM
PDF
How I Accidentally Discovered MVVM
PPTX
VIPER Architecture
PDF
App structure Fundamentals
PDF
MVVM+Router with Swift
PDF
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
PDF
Android Architectures
PPTX
Mvc vs mvp vs mvvm a guide on architecture presentation patterns
PPTX
MVP vs MVVM : a fast introduction
ODP
VIPER
PPTX
MV(X) architecture patterns
PPTX
iOS design patterns: MVC, MVP and MVVM
VIPER ( ? OR : AND) MVVM
iOS architecture patterns
Ui design patterns
Clean VIP (Clean Swift) architecture
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Infinum iOS Talks #2 - VIPER for everybody by Damjan Vujaklija
Common iOS Architecture: From MVC to VIPER, with Redux
Models used in iOS programming, with a focus on MVVM
How I Accidentally Discovered MVVM
VIPER Architecture
App structure Fundamentals
MVVM+Router with Swift
"iOS: MVVMC" - Aleksandr Nikolajev from Mooncascade
Android Architectures
Mvc vs mvp vs mvvm a guide on architecture presentation patterns
MVP vs MVVM : a fast introduction
VIPER
MV(X) architecture patterns
iOS design patterns: MVC, MVP and MVVM
Ad

Recently uploaded (20)

PDF
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Nekopoi APK 2025 free lastest update
PPTX
history of c programming in notes for students .pptx
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Operating system designcfffgfgggggggvggggggggg
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
Patient Appointment Booking in Odoo with online payment
Navsoft: AI-Powered Business Solutions & Custom Software Development
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
iTop VPN Crack Latest Version Full Key 2025
Design an Analysis of Algorithms II-SECS-1021-03
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Complete Guide to Website Development in Malaysia for SMEs
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Advanced SystemCare Ultimate Crack + Portable (2025)
Why Generative AI is the Future of Content, Code & Creativity?
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Wondershare Filmora 15 Crack With Activation Key [2025
Computer Software and OS of computer science of grade 11.pptx
Nekopoi APK 2025 free lastest update
history of c programming in notes for students .pptx
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Operating system designcfffgfgggggggvggggggggg

Choosing the architecture