SlideShare a Scribd company logo
Model View Controller
MVC Web Software Architecture
University of Lahore
Nosheen Qamar
Introduction
• Model View Controller or MVC as it is popularly called, is
a software design pattern for developing web
applications.
• Model–view–controller (MVC) is a software
architecture pattern which separates the representation
of information from the user's interaction with it .
Parts of MVC
• A Model View Controller pattern is made up of the
following three parts:
• Model
• View
• Controller
The MVC model defines web
applications with 3 logic
layers:
The business layer (Model
logic)
The display layer (View logic)
The input control (Controller
logic)
Web engineering - MVC
Model
• The model is responsible for managing the data
of the application.
• It responds to the request from the view and it
also responds to instructions from the controller
to update itself
• It is the lowest level of the pattern which is
responsible for maintaining data.
• The Model represents the application core (for
instance a list of database records).
• It is also called the domain layer
View
• The View displays the data (the database
records).
• A view requests information from the
model, that it needs to generate an output
representation.
• MVC is often seen in web applications,
where the view is the HTML page.
Controller
• The Controller is the part of the
application that handles user interaction.
• Typically controllers read data from a
view, control user input, and send input
data to the model.
• It handles the input, typically user actions
and may invoke changes on the model
and view.
Workflow in MVC - Example
Though MVC comes in di erent flavours, theff
control flow generally works as follows:
1. The user interacts with the user interface in
some way (e.g., user presses a button)
2. A controller handles the input event from the
user interface, often via a registered handler or
callback.
3. The controller accesses the model, possibly
updating it in a way appropriate to the user’s
action (e.g., controller updates user’s shopping
cart).
4. A view uses the model to generate an
appropriate user interface (e.g., view
produces a screen listing the shopping cart
contents).
The view gets its own data from the model.
The model has no direct knowledge of the
view.
Dependence hierarchy
• There is usually a kind of hierarchy in the
MVC pattern.
• The Model knows only about itself.
• That is, the source code of the Model has
no references to either the View or
Controller.
• The View however, knows about the
Model. It will poll the Model about the
state, to know what to display.
• That way, the View can display something
that is based on what the Model has done.
• But the View knows nothing about the
Controller.
• The Controller knows about both the
Model and the View.
Why dependence hierarchy is
used?
• The reason to keep it this way is to
minimize dependencies.
• No matter how the View class is modified,
the Model will still work.
• Even if the system is moved from a
desktop operating system to a smart
phone, the Model can be moved with no
changes.
• But the View probably needs to be
updated, as will the Controller.
Working of MVC in web application
Normal Web Page vs. MVC
• The MVC programming model is a lighter
alternative to traditional Web Page/Forms.
• It is a lightweight, highly testable
framework, integrated with all existing
features, such as Security, and
Authentication.
MVC Folders
• Application information
Properties
References
• Application folders
App_Data Folder
Content Folder
Controllers Folder
Models Folder
Scripts Folder
Views Folder
Configuration files
Global.asax
packages.config
Web.config
Advantages
• Clear separation between presentation
logic and business logic.
• Each object in mvc have distinct
responsibilities.
• parallel development
• easy to maintain and future
enhancements
• All objects and classes are independent of
each other.
Disadvantages
• Increased complexity
• Inefficiency of data access in view
• Difficulty of using MVC with modern user
interface too.
• For parallel development there is a
needed multiple programmers.
• Knowledge on multiple technologies is
required.

More Related Content

PPT
Mvc architecture
PPTX
Struts introduction
PPT
Struts
PPTX
Web Engineering - Web Application Testing
PPTX
Srs online shoping
PDF
Asp .net web form fundamentals
DOC
Onlineshopping
Mvc architecture
Struts introduction
Struts
Web Engineering - Web Application Testing
Srs online shoping
Asp .net web form fundamentals
Onlineshopping

What's hot (20)

PPT
Web Engineering
PPT
System Models in Software Engineering SE7
PPTX
PDF
Model View Controller (MVC)
PPSX
Class Diagram for Online Examination system
PPTX
software Prototyping model
PPTX
Angular 2.0 forms
PDF
3. ch 2-process model
PPTX
Software Engineering Layered Technology Software Process Framework
PPTX
anatomy of a jsp page & jsp syntax.pptx
PPTX
Movie Ticket Booking Website Project Presentation
PPT
PPTX
Software Process Models
PPTX
Software maintenance Unit5
PPT
Custom Controls in ASP.net
PPTX
Activity diagram
PPTX
Strategy of software design
DOCX
Bank management system
PDF
Spring annotation
Web Engineering
System Models in Software Engineering SE7
Model View Controller (MVC)
Class Diagram for Online Examination system
software Prototyping model
Angular 2.0 forms
3. ch 2-process model
Software Engineering Layered Technology Software Process Framework
anatomy of a jsp page & jsp syntax.pptx
Movie Ticket Booking Website Project Presentation
Software Process Models
Software maintenance Unit5
Custom Controls in ASP.net
Activity diagram
Strategy of software design
Bank management system
Spring annotation
Ad

Similar to Web engineering - MVC (20)

PPT
Mvc 130330091359-phpapp01
PPT
Ppt of Basic MVC Structure
ODP
Model View Controller
PDF
Mvc Architecture in a web based application
PPTX
Model View Controller ext4
PPTX
Mvc pattern and implementation in java fair
PPTX
MVC.pptx
PDF
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
PPTX
MVC Framework
ODP
Mvc
PDF
MVC Architecture
PDF
Task 2 - Educational Article – Model View Controller (MVC)
PDF
Model View Madness
PDF
L13 Presentation Layer Design
KEY
Introduction to ASP.NET MVC
PPT
MVC architecture in software programming for interactive apps
PPTX
Model view controller (mvc)
PDF
MVC in PHP
PDF
Mvc 130330091359-phpapp01
Ppt of Basic MVC Structure
Model View Controller
Mvc Architecture in a web based application
Model View Controller ext4
Mvc pattern and implementation in java fair
MVC.pptx
IRJET- MVC Framework: A Modern Web Application Development Approach and Working
MVC Framework
Mvc
MVC Architecture
Task 2 - Educational Article – Model View Controller (MVC)
Model View Madness
L13 Presentation Layer Design
Introduction to ASP.NET MVC
MVC architecture in software programming for interactive apps
Model view controller (mvc)
MVC in PHP
Ad

More from Nosheen Qamar (8)

PPTX
Web engineering - Measuring Effort Prediction Power and Accuracy
PPTX
Web Engineering - Web Effort Estimation
PPTX
Web Engineering - Web Applications versus Conventional Software
PPTX
Web Engineering - Basic CSS Properties
PPTX
Web Engineering - Introduction to CSS
PPTX
Web engineering - HTML Form
PPTX
Web engineering - An overview about HTML
PPTX
Need for Web Engineering
Web engineering - Measuring Effort Prediction Power and Accuracy
Web Engineering - Web Effort Estimation
Web Engineering - Web Applications versus Conventional Software
Web Engineering - Basic CSS Properties
Web Engineering - Introduction to CSS
Web engineering - HTML Form
Web engineering - An overview about HTML
Need for Web Engineering

Recently uploaded (20)

PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Cell Types and Its function , kingdom of life
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Lesson notes of climatology university.
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Institutional Correction lecture only . . .
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
RMMM.pdf make it easy to upload and study
Cell Types and Its function , kingdom of life
Supply Chain Operations Speaking Notes -ICLT Program
O7-L3 Supply Chain Operations - ICLT Program
Pharma ospi slides which help in ospi learning
Lesson notes of climatology university.
O5-L3 Freight Transport Ops (International) V1.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Complications of Minimal Access Surgery at WLH
Final Presentation General Medicine 03-08-2024.pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
VCE English Exam - Section C Student Revision Booklet
Institutional Correction lecture only . . .
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
2.FourierTransform-ShortQuestionswithAnswers.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Final Presentation General Medicine 03-08-2024.pptx

Web engineering - MVC

  • 1. Model View Controller MVC Web Software Architecture University of Lahore Nosheen Qamar
  • 2. Introduction • Model View Controller or MVC as it is popularly called, is a software design pattern for developing web applications. • Model–view–controller (MVC) is a software architecture pattern which separates the representation of information from the user's interaction with it .
  • 3. Parts of MVC • A Model View Controller pattern is made up of the following three parts: • Model • View • Controller
  • 4. The MVC model defines web applications with 3 logic layers: The business layer (Model logic) The display layer (View logic) The input control (Controller logic)
  • 6. Model • The model is responsible for managing the data of the application. • It responds to the request from the view and it also responds to instructions from the controller to update itself • It is the lowest level of the pattern which is responsible for maintaining data. • The Model represents the application core (for instance a list of database records). • It is also called the domain layer
  • 7. View • The View displays the data (the database records). • A view requests information from the model, that it needs to generate an output representation. • MVC is often seen in web applications, where the view is the HTML page.
  • 8. Controller • The Controller is the part of the application that handles user interaction. • Typically controllers read data from a view, control user input, and send input data to the model. • It handles the input, typically user actions and may invoke changes on the model and view.
  • 9. Workflow in MVC - Example Though MVC comes in di erent flavours, theff control flow generally works as follows: 1. The user interacts with the user interface in some way (e.g., user presses a button) 2. A controller handles the input event from the user interface, often via a registered handler or callback. 3. The controller accesses the model, possibly updating it in a way appropriate to the user’s action (e.g., controller updates user’s shopping cart).
  • 10. 4. A view uses the model to generate an appropriate user interface (e.g., view produces a screen listing the shopping cart contents). The view gets its own data from the model. The model has no direct knowledge of the view.
  • 11. Dependence hierarchy • There is usually a kind of hierarchy in the MVC pattern. • The Model knows only about itself. • That is, the source code of the Model has no references to either the View or Controller.
  • 12. • The View however, knows about the Model. It will poll the Model about the state, to know what to display. • That way, the View can display something that is based on what the Model has done. • But the View knows nothing about the Controller. • The Controller knows about both the Model and the View.
  • 13. Why dependence hierarchy is used? • The reason to keep it this way is to minimize dependencies. • No matter how the View class is modified, the Model will still work. • Even if the system is moved from a desktop operating system to a smart phone, the Model can be moved with no changes. • But the View probably needs to be updated, as will the Controller.
  • 14. Working of MVC in web application
  • 15. Normal Web Page vs. MVC • The MVC programming model is a lighter alternative to traditional Web Page/Forms. • It is a lightweight, highly testable framework, integrated with all existing features, such as Security, and Authentication.
  • 16. MVC Folders • Application information Properties References • Application folders App_Data Folder Content Folder Controllers Folder Models Folder Scripts Folder Views Folder Configuration files Global.asax packages.config Web.config
  • 17. Advantages • Clear separation between presentation logic and business logic. • Each object in mvc have distinct responsibilities. • parallel development • easy to maintain and future enhancements • All objects and classes are independent of each other.
  • 18. Disadvantages • Increased complexity • Inefficiency of data access in view • Difficulty of using MVC with modern user interface too. • For parallel development there is a needed multiple programmers. • Knowledge on multiple technologies is required.