MVC architecture

Emily Bauman
Emily BaumanSoftware Development Intern at Incessant Technologies em Incessant Technologies
MVC Architecture
Emily Bauman
Overview
MVC structure is a design pattern for web
applications, with three components:
● Model
● View
● Controller
Overview
Model
● Responsible for maintaining data
● Represents knowledge - can be a single
object or a structure of objects
View
● Responsible for displaying data to user
● Representation of the model
○ presentation filter
○ shows only chosen data to the user
Controller
● Controls interactions between model & view
● Link between user and system
● The “brains” of the application
● Controls data flow into the model and
updates the view when data changes
Simple Example
Model View Controller
HTML CSS Web Browser
● Bare text
● The content, knowledge
of a web page
● Styling
● The display of a web
page
● Brings it all together
● Displays the view with
the knowledge of the
model, allowing
interaction for the user
Why is it used?
● Isolates the business logic from the user
interface
● Allows the application to be skinnable
○ same data with changeable views
Frameworks
Many programming frameworks have adopted
MVC concepts, including:
● Spring
● Django
● Ruby on Rails
● Struts
● ASP.NET
Our project
● Spring Web MVC framework
○ DispatcherServlet
○ ModelAndView object
○ Annotations
DispatcherServlet
● Dispatches requests to controllers
● Integrated with Spring IoC container
Spring MVC
Our Structure
● Model: ModelAndView object
● View: JSP pages
● Controller: Spring MVC controller
Model: ModelAndView
● Used ModelAndView object as our model
● Spring MVC object: represents a model and
view returned by a handler
● Model is a map with <K,V>
View: JSP
● Used JSP pages as the view
● Calls in attributes of the model
Controller: Spring MVC
● Defined with @Controller annotation
● @RequestMapping annotation to map URLs
to particular handler methods
Spring MVC Example
@RequestMapping(value = "/approvetask", method = RequestMethod.POST)
public ModelAndView approveTask() {
ModelAndView model = new ModelAndView();
model.addObject("msg", "You have approved an employee task.");
model.setViewName("mytasks");
return model;
}
Spring MVC Example
<c:if test="${not empty msg}">
<div class="msg">${msg}</div>
</c:if>
Spring MVC Example
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
Resources
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/ModelAndView.html
https://spring.io/guides/gs/rest-service/
1 de 20

Recomendados

Model View Controller (MVC) por
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)Javier Antonio Humarán Peñuñuri
36.3K visualizações14 slides
Mvc architecture por
Mvc architectureMvc architecture
Mvc architectureSurbhi Panhalkar
44.5K visualizações28 slides
Introduction to mvc architecture por
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architectureravindraquicsolv
1.3K visualizações17 slides
ASP.NET MVC. por
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.Ni
1.1K visualizações12 slides
Introduction to asp.net por
Introduction to asp.netIntroduction to asp.net
Introduction to asp.netSHADAB ALI
2.6K visualizações15 slides
ASP.NET MVC Presentation por
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
23.6K visualizações11 slides

Mais conteúdo relacionado

Mais procurados

Web api por
Web apiWeb api
Web apiSudhakar Sharma
17.8K visualizações30 slides
MVC Framework por
MVC FrameworkMVC Framework
MVC FrameworkAshton Feller
1.4K visualizações27 slides
Model view controller (mvc) por
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)M Ahsan Khan
787 visualizações28 slides
MVC ppt presentation por
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
14K visualizações36 slides
Jsp ppt por
Jsp pptJsp ppt
Jsp pptVikas Jagtap
22.2K visualizações94 slides
DOT Net overview por
DOT Net overviewDOT Net overview
DOT Net overviewchandrasekhardesireddi
1.8K visualizações28 slides

Mais procurados(20)

Web api por Sudhakar Sharma
Web apiWeb api
Web api
Sudhakar Sharma17.8K visualizações
MVC Framework por Ashton Feller
MVC FrameworkMVC Framework
MVC Framework
Ashton Feller1.4K visualizações
Model view controller (mvc) por M Ahsan Khan
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)
M Ahsan Khan787 visualizações
MVC ppt presentation por Bhavin Shah
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
Bhavin Shah14K visualizações
Jsp ppt por Vikas Jagtap
Jsp pptJsp ppt
Jsp ppt
Vikas Jagtap22.2K visualizações
ASP.NET MVC Presentation por Volkan Uzun
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
Volkan Uzun5.4K visualizações
Spring MVC Framework por Hùng Nguyễn Huy
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
Hùng Nguyễn Huy3.9K visualizações
Introduction to the Web API por Brad Genereaux
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
Brad Genereaux14.5K visualizações
Webservices por Gerard Sylvester
WebservicesWebservices
Webservices
Gerard Sylvester25.1K visualizações
Asp.net state management por priya Nithya
Asp.net state managementAsp.net state management
Asp.net state management
priya Nithya3.5K visualizações
AngularJS: an introduction por Luigi De Russis
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
Luigi De Russis1K visualizações
Introduction to SignalR por Anthony Peruma
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
Anthony Peruma1.7K visualizações
ASP.NET 10 - Data Controls por Randy Connolly
ASP.NET 10 - Data ControlsASP.NET 10 - Data Controls
ASP.NET 10 - Data Controls
Randy Connolly10.6K visualizações
Introduction to asp.net por shan km
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
shan km782 visualizações
Angularjs PPT por Amit Baghel
Angularjs PPTAngularjs PPT
Angularjs PPT
Amit Baghel5.7K visualizações
Introduction to AngularJS por David Parsons
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
David Parsons1.7K visualizações
Struts por s4al_com
StrutsStruts
Struts
s4al_com1.7K visualizações
Servlet.ppt por VMahesh5
Servlet.pptServlet.ppt
Servlet.ppt
VMahesh5232 visualizações

Destaque

Ppt of Basic MVC Structure por
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC StructureDipika Wadhvani
676 visualizações27 slides
Design Pattern For C# Part 1 por
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1Shahzad
7.1K visualizações19 slides
MVC Seminar Presantation por
MVC Seminar PresantationMVC Seminar Presantation
MVC Seminar PresantationAbhishek Yadav
6.8K visualizações41 slides
Why Use MVC? por
Why Use MVC?Why Use MVC?
Why Use MVC?Jesse Anderson
18.4K visualizações4 slides
Why MVC? por
Why MVC?Why MVC?
Why MVC?Wayne Tun Myint
10.5K visualizações23 slides
Android ppt por
Android pptAndroid ppt
Android pptPrasadbharatiyudu
100.4K visualizações24 slides

Destaque(6)

Ppt of Basic MVC Structure por Dipika Wadhvani
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
Dipika Wadhvani676 visualizações
Design Pattern For C# Part 1 por Shahzad
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1
Shahzad 7.1K visualizações
MVC Seminar Presantation por Abhishek Yadav
MVC Seminar PresantationMVC Seminar Presantation
MVC Seminar Presantation
Abhishek Yadav6.8K visualizações
Why Use MVC? por Jesse Anderson
Why Use MVC?Why Use MVC?
Why Use MVC?
Jesse Anderson18.4K visualizações
Why MVC? por Wayne Tun Myint
Why MVC?Why MVC?
Why MVC?
Wayne Tun Myint10.5K visualizações
Android ppt por Prasadbharatiyudu
Android pptAndroid ppt
Android ppt
Prasadbharatiyudu100.4K visualizações

Similar a MVC architecture

Design & Development of Web Applications using SpringMVC por
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC Naresh Chintalcheru
12.8K visualizações36 slides
Single page application 03 por
Single page application   03Single page application   03
Single page application 03Ismaeel Enjreny
316 visualizações9 slides
Angular introduction basic por
Angular introduction basicAngular introduction basic
Angular introduction basicjagriti srivastava
42 visualizações8 slides
Itroducing Angular JS por
Itroducing Angular JSItroducing Angular JS
Itroducing Angular JSCarlos Emanuel Mathiasen
485 visualizações17 slides
Lecture 05 - Creating a website with Razor Pages.pdf por
Lecture 05 - Creating a website with Razor Pages.pdfLecture 05 - Creating a website with Razor Pages.pdf
Lecture 05 - Creating a website with Razor Pages.pdfLê Thưởng
1 visão44 slides
Learning AngularJS - Complete coverage of AngularJS features and concepts por
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and conceptsSuresh Patidar
396 visualizações98 slides

Similar a MVC architecture(20)

Design & Development of Web Applications using SpringMVC por Naresh Chintalcheru
Design & Development of Web Applications using SpringMVC Design & Development of Web Applications using SpringMVC
Design & Development of Web Applications using SpringMVC
Naresh Chintalcheru12.8K visualizações
Single page application 03 por Ismaeel Enjreny
Single page application   03Single page application   03
Single page application 03
Ismaeel Enjreny316 visualizações
Angular introduction basic por jagriti srivastava
Angular introduction basicAngular introduction basic
Angular introduction basic
jagriti srivastava42 visualizações
Lecture 05 - Creating a website with Razor Pages.pdf por Lê Thưởng
Lecture 05 - Creating a website with Razor Pages.pdfLecture 05 - Creating a website with Razor Pages.pdf
Lecture 05 - Creating a website with Razor Pages.pdf
Lê Thưởng1 visão
Learning AngularJS - Complete coverage of AngularJS features and concepts por Suresh Patidar
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and concepts
Suresh Patidar396 visualizações
FrontEnd.pdf por stephanedjeukam1
FrontEnd.pdfFrontEnd.pdf
FrontEnd.pdf
stephanedjeukam115 visualizações
Asp.net mvc por Taranjeet Singh
Asp.net mvcAsp.net mvc
Asp.net mvc
Taranjeet Singh248 visualizações
iOS architecture patterns por allanh0526
iOS architecture patternsiOS architecture patterns
iOS architecture patterns
allanh0526510 visualizações
Introduction to-angular js por Achintya Kumar
Introduction to-angular jsIntroduction to-angular js
Introduction to-angular js
Achintya Kumar520 visualizações
ASp.net Mvc 5 por ahmedxp kh
ASp.net Mvc 5ASp.net Mvc 5
ASp.net Mvc 5
ahmedxp kh74 visualizações
MVC & backbone.js por Mohammed Arif
MVC & backbone.jsMVC & backbone.js
MVC & backbone.js
Mohammed Arif4K visualizações
AngularJS Basics - Knowledge Sharing por Branko Djurkovic
AngularJS Basics - Knowledge SharingAngularJS Basics - Knowledge Sharing
AngularJS Basics - Knowledge Sharing
Branko Djurkovic528 visualizações
Model View Controller por Madhukar Kumar
Model View ControllerModel View Controller
Model View Controller
Madhukar Kumar366 visualizações
AngularJS = Browser applications on steroids por Maurice De Beijer [MVP]
AngularJS = Browser applications on steroidsAngularJS = Browser applications on steroids
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]3.5K visualizações
Angular JS Indtrodution por adesh21
Angular JS IndtrodutionAngular JS Indtrodution
Angular JS Indtrodution
adesh2123 visualizações
Ios models por JUDYFLAVIAB
Ios modelsIos models
Ios models
JUDYFLAVIAB51 visualizações
Intro ASP MVC por KrishnaPPatel
Intro ASP MVCIntro ASP MVC
Intro ASP MVC
KrishnaPPatel424 visualizações
Spring mvc por Pravin Pundge
Spring mvcSpring mvc
Spring mvc
Pravin Pundge214 visualizações
Introduction to AngularJS por Shyjal Raazi
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Shyjal Raazi369 visualizações

Último

HarshithAkkapelli_Presentation.pdf por
HarshithAkkapelli_Presentation.pdfHarshithAkkapelli_Presentation.pdf
HarshithAkkapelli_Presentation.pdfharshithakkapelli
12 visualizações16 slides
FOSSLight Community Day 2023-11-30 por
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30Shane Coughlan
5 visualizações18 slides
Airline Booking Software por
Airline Booking SoftwareAirline Booking Software
Airline Booking SoftwareSharmiMehta
6 visualizações26 slides
MS PowerPoint.pptx por
MS PowerPoint.pptxMS PowerPoint.pptx
MS PowerPoint.pptxLitty Sylus
5 visualizações14 slides
Short_Story_PPT.pdf por
Short_Story_PPT.pdfShort_Story_PPT.pdf
Short_Story_PPT.pdfutkarshsatishkumarsh
6 visualizações16 slides
The Path to DevOps por
The Path to DevOpsThe Path to DevOps
The Path to DevOpsJohn Valentino
5 visualizações6 slides

Último(20)

HarshithAkkapelli_Presentation.pdf por harshithakkapelli
HarshithAkkapelli_Presentation.pdfHarshithAkkapelli_Presentation.pdf
HarshithAkkapelli_Presentation.pdf
harshithakkapelli12 visualizações
FOSSLight Community Day 2023-11-30 por Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan5 visualizações
Airline Booking Software por SharmiMehta
Airline Booking SoftwareAirline Booking Software
Airline Booking Software
SharmiMehta6 visualizações
MS PowerPoint.pptx por Litty Sylus
MS PowerPoint.pptxMS PowerPoint.pptx
MS PowerPoint.pptx
Litty Sylus5 visualizações
The Path to DevOps por John Valentino
The Path to DevOpsThe Path to DevOps
The Path to DevOps
John Valentino5 visualizações
WebAssembly por Jens Siebert
WebAssemblyWebAssembly
WebAssembly
Jens Siebert52 visualizações
360 graden fabriek por info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492138 visualizações
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... por TomHalpin9
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
TomHalpin96 visualizações
Sprint 226 por ManageIQ
Sprint 226Sprint 226
Sprint 226
ManageIQ8 visualizações
nintendo_64.pptx por paiga02016
nintendo_64.pptxnintendo_64.pptx
nintendo_64.pptx
paiga020165 visualizações
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx por animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm15 visualizações
ShortStory_qlora.pptx por pranathikrishna22
ShortStory_qlora.pptxShortStory_qlora.pptx
ShortStory_qlora.pptx
pranathikrishna225 visualizações
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... por NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi215 visualizações
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports por Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
Ra'Fat Al-Msie'deen8 visualizações
AI and Ml presentation .pptx por FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8712 visualizações
JioEngage_Presentation.pptx por admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254556 visualizações
Software evolution understanding: Automatic extraction of software identifier... por Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
Ra'Fat Al-Msie'deen10 visualizações
Quality Engineer: A Day in the Life por John Valentino
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino6 visualizações

MVC architecture