SlideShare a Scribd company logo
1 of 18
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)
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

What's hot

Client Server Architecture
Client Server ArchitectureClient Server Architecture
Client Server ArchitectureRence Montanes
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETRajkumarsoy
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC ArchitecturePrem Sanil
 
Software Architecture Design for Begginers
Software Architecture Design for BegginersSoftware Architecture Design for Begginers
Software Architecture Design for BegginersChinh Ngo Nguyen
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)Manisha Keim
 
Distributed System
Distributed SystemDistributed System
Distributed SystemIqra khalil
 
9. Software Implementation
9. Software Implementation9. Software Implementation
9. Software Implementationghayour abbas
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineeringPreeti Mishra
 
USER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPTUSER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPTvicci4041
 
Software architecture design ppt
Software architecture design pptSoftware architecture design ppt
Software architecture design pptfarazimlak
 
Web Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo FadojutimiWeb Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo FadojutimiTemitayo Fadojutimi
 

What's hot (20)

Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Client Server Architecture
Client Server ArchitectureClient Server Architecture
Client Server Architecture
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
Software Architecture Design for Begginers
Software Architecture Design for BegginersSoftware Architecture Design for Begginers
Software Architecture Design for Begginers
 
Why MVC?
Why MVC?Why MVC?
Why MVC?
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
 
Servlets
ServletsServlets
Servlets
 
CS8651 IP Unit 3.pptx
CS8651 IP Unit 3.pptxCS8651 IP Unit 3.pptx
CS8651 IP Unit 3.pptx
 
Distributed System
Distributed SystemDistributed System
Distributed System
 
9. Software Implementation
9. Software Implementation9. Software Implementation
9. Software Implementation
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
 
USER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPTUSER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPT
 
Servlets
ServletsServlets
Servlets
 
Software architecture design ppt
Software architecture design pptSoftware architecture design ppt
Software architecture design ppt
 
Web Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo FadojutimiWeb Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo Fadojutimi
 

Similar to Web engineering - MVC

Similar to Web engineering - MVC (20)

Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01
 
MVC architecture
MVC architectureMVC architecture
MVC architecture
 
Architectural Design & Patterns
Architectural Design&PatternsArchitectural Design&Patterns
Architectural Design & Patterns
 
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
 
Mvc pattern and implementation in java fair
Mvc   pattern   and implementation   in   java fairMvc   pattern   and implementation   in   java fair
Mvc pattern and implementation in java fair
 
MVC.pptx
MVC.pptxMVC.pptx
MVC.pptx
 
MVC - In Details
MVC - In DetailsMVC - In Details
MVC - In Details
 
MVVM and Prism
MVVM and PrismMVVM and Prism
MVVM and Prism
 
Model View Controller
Model View ControllerModel View Controller
Model View Controller
 
MVC
MVCMVC
MVC
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
MVC
MVCMVC
MVC
 
MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017MVC architecture by Mohd.Awais on 18th Aug, 2017
MVC architecture by Mohd.Awais on 18th Aug, 2017
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Interaction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptxInteraction-Oriented Architecture.pptx
Interaction-Oriented Architecture.pptx
 
Mvc part 1
Mvc part 1Mvc part 1
Mvc part 1
 
MVC Seminar Presantation
MVC Seminar PresantationMVC Seminar Presantation
MVC Seminar Presantation
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
 

More from Nosheen Qamar

Web engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and AccuracyWeb engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and AccuracyNosheen Qamar
 
Web Engineering - Web Effort Estimation
Web Engineering - Web Effort EstimationWeb Engineering - Web Effort Estimation
Web Engineering - Web Effort EstimationNosheen Qamar
 
Web Engineering - Web Applications versus Conventional Software
Web Engineering - Web Applications versus Conventional SoftwareWeb Engineering - Web Applications versus Conventional Software
Web Engineering - Web Applications versus Conventional SoftwareNosheen Qamar
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesNosheen Qamar
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSSNosheen Qamar
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML FormNosheen Qamar
 
Web engineering - An overview about HTML
Web engineering -  An overview about HTMLWeb engineering -  An overview about HTML
Web engineering - An overview about HTMLNosheen Qamar
 
Need for Web Engineering
Need for Web EngineeringNeed for Web Engineering
Need for Web EngineeringNosheen Qamar
 

More from Nosheen Qamar (8)

Web engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and AccuracyWeb engineering - Measuring Effort Prediction Power and Accuracy
Web engineering - Measuring Effort Prediction Power and Accuracy
 
Web Engineering - Web Effort Estimation
Web Engineering - Web Effort EstimationWeb Engineering - Web Effort Estimation
Web Engineering - Web Effort Estimation
 
Web Engineering - Web Applications versus Conventional Software
Web Engineering - Web Applications versus Conventional SoftwareWeb Engineering - Web Applications versus Conventional Software
Web Engineering - Web Applications versus Conventional Software
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML Form
 
Web engineering - An overview about HTML
Web engineering -  An overview about HTMLWeb engineering -  An overview about HTML
Web engineering - An overview about HTML
 
Need for Web Engineering
Need for Web EngineeringNeed for Web Engineering
Need for Web Engineering
 

Recently uploaded

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Recently uploaded (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

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)
  • 5.
  • 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.