What Is MVT

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 8

Model View Template (MVT)

The MVT is an design pattern that separates an application into three main logical
components Model, View, and Template.
Each of these component has their own role in a Project.
Model
The Model responsible to handle database. It is a data access layer which handles the
data.
View
The user can send request by interacting with template, the view handles these requests
and sends to Model then get appropriate response from the Model, sends response to
template.
It may also have required logics.
It works as a mediator between Template and Model.
Template
It represents how data should be presented to the application user. User can read or
write the data from template.
Basically it is responsible for showing end user content, we can say it is user interface.
It may consists of HTML, CSS, JS mixed with Django Template Language.
• Server Side Logic
• Process GET/POST
• Get data from User
• Gets data from Model
• Pass data to Template

View • Insert/Update DB
• Communicate with
View

Routing Model

Template

• User Interface
• HTML/CSS Database
• Get Data from View
• Server Side Logic
• Process GET/POST
• Get data from User
• Gets data from Model
• Pass data to Template

Urls View • Process Data


• Insert/Update DB
• Communicate with
View

Model

Template

• User Interface
• HTML/CSS Database
• Get Data from View
Why use MVT
• Organized Code
• Independent Block
• Reduces the complexity of web applications
• Easy to Maintain
• Easy to modify
Basic Structure

You might also like