0% found this document useful (0 votes)
5 views

Lecture 2

The document discusses the MVC (Model-View-Controller) architectural pattern used in web frameworks development with JavaScript. It outlines the roles of each component: the Model manages data, the View represents the user interface, and the Controller acts as an intermediary between the Model and View. The advantages of MVC include improved readability, modularity, and easier testing.

Uploaded by

ericcostermboya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lecture 2

The document discusses the MVC (Model-View-Controller) architectural pattern used in web frameworks development with JavaScript. It outlines the roles of each component: the Model manages data, the View represents the user interface, and the Controller acts as an intermediary between the Model and View. The advantages of MVC include improved readability, modularity, and easier testing.

Uploaded by

ericcostermboya
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

CP 323: Web Frameworks Development

Using JavaScript.
Frameworks Architecture
Frameworks Architecture
● MVC is known as an architectural
pattern, which embodies three parts
Model, View and Controller.
● It divides the application into three
logical parts: the model, the view
and the controller.
Frameworks Architecture
● It was used for desktop graphical user
interfaces but nowadays is used in
designing mobile apps and web apps.
● MVC is an architectural pattern which
means it rules the whole architecture of
the applications.
Frameworks Architecture

● Trygve Reenskaug invented MVC.


● The first reports on MVC were
written when he was visiting a
scientist at Xerox Palo Alto Research
Laboratory (PARC) in 1978/79.
MVC Model
● It is known as the lowest level which means
it is responsible for maintaining data.
● Handle data logically so it basically deals
with data.
● The model is actually connected to the
database so anything you do with data.
MVC Model

● Adding or retrieving data is done in


the model component.
● It responds to the controller
requests because the controller
never talks to the database by itself.
MVC Model

● The model talks to the database


back and forth and then it gives the
needed data to the controller.
● The model never communicated
with the view directly.
MVC View

● Data representation is done by the


view component.
● It actually generates UI or user
interface for the user.
MVC View

● In web applications when you think


of the view component just think the
Html/CSS part.
● Views are created by the data which
is collected by the model component
MVC Controller

● It’s known as the main man because


the controller is the component that
enables the interconnection
between the views and the model so
it acts as an intermediary.
MVC Controller

● Represents the business logics


● The controller doesn’t have to worry
about handling data logic, it just tells
the model what to do.
● Receives data and processes it.
Advantages of MVC

● This ‘division’ enables readability and


modularity as well it easier the
testing part.
Quiz

What are the disadvantages of MVC?


END

You might also like