Model View Controller pattern
Álvaro Alonso
Model View Controller (MVC)
Architectural pattern used for developing user interfaces
It divides the application in three parts
– Model
• Maintains the state of the application (data)
– View
• Shows data to the user
– Controller
• Manages the user interaction updating the model accordingly
2
Model View Controller (MVC)
Model
View
Controller
3
Alternatives
There are several variants of MVC pattern
MVP: Model – View – Presenter
PAC: Presentation – Abstraction – Control
MVVM: Model – View –ViewModel
…
4
MVC in server side
Model
DB
View
Controller
Browser Server
5
MVC in client side
Model DB
View
Controller
Browser
Server
6
Client vs Server
Model
DB
View
Controller
Browser Server
Model DB
View
Controller
Browser
Server
7
Client vs Server
Factors to take into account
– Type of processing
– Task reuse
– Servers characteristics
– Type of users / devices
– Security constraints
– Developers skills
8
Client Technologies
9
Server Technologies
Node JS Ruby Python
Java
10
Model View Controller pattern
Álvaro Alonso