際際滷

際際滷Share a Scribd company logo
MVC TRAINING DAY-1
1
QuicSolvTechnologiesPvt.Ltd.
INTRODUCTION TO MVC ASP.NET
ARCHITECTURE
 ASP.NET MVC is a part of ASP.NET and not an
entirely separate Framework.
 The Model-View-Controller (MVC) pattern is an
architectural design principle that separates the
components of a Web application. This separation
gives you more control over the individual parts of
the application, which lets you more easily develop,
modify, and test them.
 ASP.NET MVC is part of the ASP.NET framework.
Developing an ASP.NET MVC application is an
alternative to developing ASP.NET Web Forms
pages; it does not replace the Web Forms model.
2
QuicSolvTechnologiesPvt.Ltd.
INTRODUCTION TO MVC ASP.NET
ARCHITECTURE
3
QuicSolvTechnologiesPvt.Ltd.
MODEL-VIEW-CONTROLLER
 Controller: - The controller is like a traffic cop.
Whenever user requests any resource it first goes
to the controller. Controller than interact with both
the Model and View.
 Model: - The model is responsible for the data for
the application and also it creates data for the view.
It handles data processing and database works
part.
 View: - It is a presentation layer i.e. it shows the
data to the users.
4
QuicSolvTechnologiesPvt.Ltd.
BASIC CONVENTIONS IN ASP.NET MVC
 There is single controller directory which holds your
controller classes.
 Each controllers name ends with Controller e.g. :
HomeController
 Views that controller use live in subdirectory of the
Views main directory. Directory for above
HomeController will be Views/Home
 All reusable UI elements live in similar structure
above but in a Shared directory on Root.
5
QuicSolvTechnologiesPvt.Ltd.
BASIC CONVENTIONS IN ASP.NET MVC
 Controller contains all
Controller classes.
 Models contains all
Models classes.
 Views contains
associated views.
 Content contains all
CSS / Images / other
libraries
 Script contains default
scripts loaded MVC
6
QuicSolvTechnologiesPvt.Ltd.
7
QuicSolvTechnologiesPvt.Ltd.
ASP.NET WEB FORMS
VS
ASP.NET MVC
 ASP.NET WeB Form
 Does well with
Abstraction
 Not fully Testable
 Not much HTML
Expertise required
 Less maintainable
 Supported by heaps of
third party Server side
controls and tools.
 ASP.NET MVC
 Works with SoC
principle
 Best for TDD
 HTML knowledge is
required
 Highly maintainable
 Supported by various
Third party JavaScript
controls
ASP.NET MVC  VIEW ENGINE
8
QuicSolvTechnologiesPvt.Ltd.
 Types of View Engine
 System.Web.Mvc.WebFormViewEngine
 System.Web.Razor
 Bellevue
 Brail
 NDjango using the F#
 Many More.
WHY VIEW ENGINES
 Syntax
 Skill set/background
 Productivity
 Testability
 View engines that dont depend on the System.Web.UI.Page
are easier to test than the default ASP.NET MVC view engine,
which uses Page for a base class of its view implementation.
 Division of labor
 If you have designers working on the views, or just want
minimal logic in your views, you should choose a view engine
that easily mixes with Html.
 Step 1
ASP.NET MVC REQUEST FLOW
Incoming request directed to
Controller
Request
Controller
 Step 2
ASP.NET MVC REQUEST FLOW
Controller processes request and forms
a data Model
Request
Controller
Model
ASP.NET MVC REQUEST FLOW
 Step 3
12
QuicSolvTechnologiesPvt.Ltd.
Model is passed to View
Request
Controller
Model
View
ASP.NET MVC REQUEST FLOW
 Step 4
13
QuicSolvTechnologiesPvt.Ltd.
View transforms Model into
appropriate output format
Request
Controller
View
Response
ASP.NET MVC REQUEST LIFE CYCLE
14
QuicSolvTechnologiesPvt.Ltd.
WHY MVC?
 It makes it easier to manage complexity by dividing an
application into the model, the view, and the controller.
 It does not use view state or server-based forms. This makes
the MVC framework ideal for developers who want full control
over the behavior of an application.
 It uses a Front Controller pattern that processes Web
application requests through a single controller. This enables
you to design an application that supports a rich routing
infrastructure. For more information, see Front Controller.
 It provides better support for test-driven development (TDD).
 It works well for Web applications that are supported by large
teams of developers and for Web designers who need a high
degree of control over the application behavior.
15
QuicSolvTechnologiesPvt.Ltd.
 ANY QUESTIONS???????????
16
QuicSolvTechnologiesPvt.Ltd.
 THANK YOU
17
QuicSolvTechnologiesPvt.Ltd.

More Related Content

What's hot (20)

MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
Bhavin Shah
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training session
Hrichi Mohamed
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
H湛ng Nguy畛n Huy
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
Bhagath Gopinath
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
Volkan Uzun
Spring mvc
Spring mvcSpring mvc
Spring mvc
Pravin Pundge
Spring MVC
Spring MVCSpring MVC
Spring MVC
Aaron Schram
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
Piyush Aggarwal
MVx patterns in iOS (MVC, MVP, MVVM)
MVx patterns in iOS (MVC, MVP, MVVM)MVx patterns in iOS (MVC, MVP, MVVM)
MVx patterns in iOS (MVC, MVP, MVVM)
Yaroslav Voloshyn
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
Spring mvc
Spring mvcSpring mvc
Spring mvc
Hamid Ghorbani
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
Divya Sharma
Laravel overview
Laravel overviewLaravel overview
Laravel overview
Obinna Akunne
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
Manish Shekhawat
iOS Architectures
iOS ArchitecturesiOS Architectures
iOS Architectures
Hung Hoang
Spring boot
Spring bootSpring boot
Spring boot
Pradeep Shanmugam
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
ASP.MVC Training
ASP.MVC TrainingASP.MVC Training
ASP.MVC Training
Mahesh Sikakolli
Design pattern-presentation
Design pattern-presentationDesign pattern-presentation
Design pattern-presentation
Rana Muhammad Asif
React JS
React JSReact JS
React JS
Software Infrastructure
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
Bhavin Shah
Asp.net MVC training session
Asp.net MVC training sessionAsp.net MVC training session
Asp.net MVC training session
Hrichi Mohamed
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
Bhagath Gopinath
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
Volkan Uzun
MVx patterns in iOS (MVC, MVP, MVVM)
MVx patterns in iOS (MVC, MVP, MVVM)MVx patterns in iOS (MVC, MVP, MVVM)
MVx patterns in iOS (MVC, MVP, MVVM)
Yaroslav Voloshyn
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
Manish Shekhawat
iOS Architectures
iOS ArchitecturesiOS Architectures
iOS Architectures
Hung Hoang
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
Shahed Chowdhuri
Design pattern-presentation
Design pattern-presentationDesign pattern-presentation
Design pattern-presentation
Rana Muhammad Asif

Similar to Introduction to mvc architecture (20)

Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development services
Aaron Jacobson
Mvc
MvcMvc
Mvc
abhigad
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
Naga Harish M
Best Institute for ASP NET MVC Course in India
Best Institute for ASP NET MVC Course in IndiaBest Institute for ASP NET MVC Course in India
Best Institute for ASP NET MVC Course in India
IT DESK INDIA
MVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros DeveloperMVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros Developer
Nyros Technologies
Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1
Gaurav Arora
ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1
Gaurav Arora
Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rtt
Lanvige Jiang
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
Indiandotnet
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.net
Concetto Labs
Mvc part 1
Mvc part 1Mvc part 1
Mvc part 1
Gandhi Ghanashyam
An overview of microsoft mvc dot net
An overview of microsoft mvc dot netAn overview of microsoft mvc dot net
An overview of microsoft mvc dot net
neha sharma
ASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemASP.Net | Sabin Saleem
ASP.Net | Sabin Saleem
SaBin SaleEm
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
Dipika Wadhvani
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
Taranjeet Singh
Aspnet mvc
Aspnet mvcAspnet mvc
Aspnet mvc
Hiep Luong
Asp.net Mvc Introduction
Asp.net Mvc IntroductionAsp.net Mvc Introduction
Asp.net Mvc Introduction
Vishal Sharma
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
AHM Pervej Kabir
Intro ASP MVC
Intro ASP MVCIntro ASP MVC
Intro ASP MVC
KrishnaPPatel
MVC architecture
MVC architectureMVC architecture
MVC architecture
baabtra.com - No. 1 supplier of quality freshers
Technoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development servicesTechnoligent providing custom ASP.NET MVC development services
Technoligent providing custom ASP.NET MVC development services
Aaron Jacobson
Best Institute for ASP NET MVC Course in India
Best Institute for ASP NET MVC Course in IndiaBest Institute for ASP NET MVC Course in India
Best Institute for ASP NET MVC Course in India
IT DESK INDIA
MVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros DeveloperMVC Architecture in ASP.Net By Nyros Developer
MVC Architecture in ASP.Net By Nyros Developer
Nyros Technologies
Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1
Gaurav Arora
ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1
Gaurav Arora
Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rtt
Lanvige Jiang
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
Indiandotnet
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.net
Concetto Labs
An overview of microsoft mvc dot net
An overview of microsoft mvc dot netAn overview of microsoft mvc dot net
An overview of microsoft mvc dot net
neha sharma
ASP.Net | Sabin Saleem
ASP.Net | Sabin SaleemASP.Net | Sabin Saleem
ASP.Net | Sabin Saleem
SaBin SaleEm
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
Dipika Wadhvani
Asp.net Mvc Introduction
Asp.net Mvc IntroductionAsp.net Mvc Introduction
Asp.net Mvc Introduction
Vishal Sharma
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
AHM Pervej Kabir

Recently uploaded (20)

Chapter 6-firewalls-whitman-information security.ppt
Chapter 6-firewalls-whitman-information security.pptChapter 6-firewalls-whitman-information security.ppt
Chapter 6-firewalls-whitman-information security.ppt
ayeshabatool947681
Generative artificial intelligence in EU Grant Writing
Generative artificial intelligence in EU Grant WritingGenerative artificial intelligence in EU Grant Writing
Generative artificial intelligence in EU Grant Writing
Peter Trkman
Epochalypse 2038 - Remediating the 32-bit Timestamp Risk at Global Scale (Pub...
Epochalypse 2038 - Remediating the 32-bit Timestamp Risk at Global Scale (Pub...Epochalypse 2038 - Remediating the 32-bit Timestamp Risk at Global Scale (Pub...
Epochalypse 2038 - Remediating the 32-bit Timestamp Risk at Global Scale (Pub...
treyka
IETF 122: draft-ietf-regext-rdap-rir-search-16
IETF 122: draft-ietf-regext-rdap-rir-search-16IETF 122: draft-ietf-regext-rdap-rir-search-16
IETF 122: draft-ietf-regext-rdap-rir-search-16
APNIC
Odoo Migration Services-1 .pdf
Odoo Migration Services-1           .pdfOdoo Migration Services-1           .pdf
Odoo Migration Services-1 .pdf
dela33martin33
Press Conference Future of Business: Trends and Predictions for 2025
Press Conference Future of Business: Trends and Predictions for 2025Press Conference Future of Business: Trends and Predictions for 2025
Press Conference Future of Business: Trends and Predictions for 2025
SanskarTiwari20
Expert Odoo Support Services .pdf
Expert Odoo Support Services         .pdfExpert Odoo Support Services         .pdf
Expert Odoo Support Services .pdf
dela33martin33
The-Power-of-Digital-Marketing-Fueling-Business-Growth.pdf
The-Power-of-Digital-Marketing-Fueling-Business-Growth.pdfThe-Power-of-Digital-Marketing-Fueling-Business-Growth.pdf
The-Power-of-Digital-Marketing-Fueling-Business-Growth.pdf
makelinkak002
Odoo demo .pdf
Odoo demo                           .pdfOdoo demo                           .pdf
Odoo demo .pdf
dela33martin33
DT Presentation[1].pptxeffsffewfwefewfewefefeef
DT Presentation[1].pptxeffsffewfwefewfewefefeefDT Presentation[1].pptxeffsffewfwefewfewefefeef
DT Presentation[1].pptxeffsffewfwefewfewefefeef
dipanshu1721
Complete Nmap Scanning Commands CheatSheet by Hackopedia Utkarsh Thakur
Complete Nmap Scanning Commands CheatSheet by Hackopedia Utkarsh ThakurComplete Nmap Scanning Commands CheatSheet by Hackopedia Utkarsh Thakur
Complete Nmap Scanning Commands CheatSheet by Hackopedia Utkarsh Thakur
Hackopedia Utkarsh Thakur
BGP Best Practices, presented by Imtiaz Sajid
BGP Best Practices, presented by Imtiaz SajidBGP Best Practices, presented by Imtiaz Sajid
BGP Best Practices, presented by Imtiaz Sajid
APNIC
PresentWEFWEFWERWERWERWERREWREWation.pptx
PresentWEFWEFWERWERWERWERREWREWation.pptxPresentWEFWEFWERWERWERWERREWREWation.pptx
PresentWEFWEFWERWERWERWERREWREWation.pptx
toxicsuprit
Blue Simple Professional CV Resume (2).pdf
Blue Simple Professional CV Resume (2).pdfBlue Simple Professional CV Resume (2).pdf
Blue Simple Professional CV Resume (2).pdf
deepakpendbhaje
Measuring ECN, presented by Geoff Huston at IETF 122
Measuring ECN, presented by Geoff Huston at IETF 122Measuring ECN, presented by Geoff Huston at IETF 122
Measuring ECN, presented by Geoff Huston at IETF 122
APNIC
Hire Odoo Consultant .pdf
Hire Odoo Consultant                .pdfHire Odoo Consultant                .pdf
Hire Odoo Consultant .pdf
dela33martin33
Chapter-2-NSA_Network System Administration.pdf
Chapter-2-NSA_Network System Administration.pdfChapter-2-NSA_Network System Administration.pdf
Chapter-2-NSA_Network System Administration.pdf
AssefaSen
際際滷s: Eco Economic Epochs World Game's Great Redesign .pdf
際際滷s: Eco Economic Epochs World Game's Great Redesign .pdf際際滷s: Eco Economic Epochs World Game's Great Redesign .pdf
際際滷s: Eco Economic Epochs World Game's Great Redesign .pdf
Steven McGee
DB.pptx data base HNS level III 2017 yearx
DB.pptx data base HNS level III 2017 yearxDB.pptx data base HNS level III 2017 yearx
DB.pptx data base HNS level III 2017 yearx
kebimesay23
ESTUDO DO ARTIGO 22 AO 39 DO CDIGO CVIL.pdf
ESTUDO DO ARTIGO 22 AO 39 DO CDIGO CVIL.pdfESTUDO DO ARTIGO 22 AO 39 DO CDIGO CVIL.pdf
ESTUDO DO ARTIGO 22 AO 39 DO CDIGO CVIL.pdf
HELLEN CRISTINA
Chapter 6-firewalls-whitman-information security.ppt
Chapter 6-firewalls-whitman-information security.pptChapter 6-firewalls-whitman-information security.ppt
Chapter 6-firewalls-whitman-information security.ppt
ayeshabatool947681
Generative artificial intelligence in EU Grant Writing
Generative artificial intelligence in EU Grant WritingGenerative artificial intelligence in EU Grant Writing
Generative artificial intelligence in EU Grant Writing
Peter Trkman
Epochalypse 2038 - Remediating the 32-bit Timestamp Risk at Global Scale (Pub...
Epochalypse 2038 - Remediating the 32-bit Timestamp Risk at Global Scale (Pub...Epochalypse 2038 - Remediating the 32-bit Timestamp Risk at Global Scale (Pub...
Epochalypse 2038 - Remediating the 32-bit Timestamp Risk at Global Scale (Pub...
treyka
IETF 122: draft-ietf-regext-rdap-rir-search-16
IETF 122: draft-ietf-regext-rdap-rir-search-16IETF 122: draft-ietf-regext-rdap-rir-search-16
IETF 122: draft-ietf-regext-rdap-rir-search-16
APNIC
Odoo Migration Services-1 .pdf
Odoo Migration Services-1           .pdfOdoo Migration Services-1           .pdf
Odoo Migration Services-1 .pdf
dela33martin33
Press Conference Future of Business: Trends and Predictions for 2025
Press Conference Future of Business: Trends and Predictions for 2025Press Conference Future of Business: Trends and Predictions for 2025
Press Conference Future of Business: Trends and Predictions for 2025
SanskarTiwari20
Expert Odoo Support Services .pdf
Expert Odoo Support Services         .pdfExpert Odoo Support Services         .pdf
Expert Odoo Support Services .pdf
dela33martin33
The-Power-of-Digital-Marketing-Fueling-Business-Growth.pdf
The-Power-of-Digital-Marketing-Fueling-Business-Growth.pdfThe-Power-of-Digital-Marketing-Fueling-Business-Growth.pdf
The-Power-of-Digital-Marketing-Fueling-Business-Growth.pdf
makelinkak002
DT Presentation[1].pptxeffsffewfwefewfewefefeef
DT Presentation[1].pptxeffsffewfwefewfewefefeefDT Presentation[1].pptxeffsffewfwefewfewefefeef
DT Presentation[1].pptxeffsffewfwefewfewefefeef
dipanshu1721
Complete Nmap Scanning Commands CheatSheet by Hackopedia Utkarsh Thakur
Complete Nmap Scanning Commands CheatSheet by Hackopedia Utkarsh ThakurComplete Nmap Scanning Commands CheatSheet by Hackopedia Utkarsh Thakur
Complete Nmap Scanning Commands CheatSheet by Hackopedia Utkarsh Thakur
Hackopedia Utkarsh Thakur
BGP Best Practices, presented by Imtiaz Sajid
BGP Best Practices, presented by Imtiaz SajidBGP Best Practices, presented by Imtiaz Sajid
BGP Best Practices, presented by Imtiaz Sajid
APNIC
PresentWEFWEFWERWERWERWERREWREWation.pptx
PresentWEFWEFWERWERWERWERREWREWation.pptxPresentWEFWEFWERWERWERWERREWREWation.pptx
PresentWEFWEFWERWERWERWERREWREWation.pptx
toxicsuprit
Blue Simple Professional CV Resume (2).pdf
Blue Simple Professional CV Resume (2).pdfBlue Simple Professional CV Resume (2).pdf
Blue Simple Professional CV Resume (2).pdf
deepakpendbhaje
Measuring ECN, presented by Geoff Huston at IETF 122
Measuring ECN, presented by Geoff Huston at IETF 122Measuring ECN, presented by Geoff Huston at IETF 122
Measuring ECN, presented by Geoff Huston at IETF 122
APNIC
Hire Odoo Consultant .pdf
Hire Odoo Consultant                .pdfHire Odoo Consultant                .pdf
Hire Odoo Consultant .pdf
dela33martin33
Chapter-2-NSA_Network System Administration.pdf
Chapter-2-NSA_Network System Administration.pdfChapter-2-NSA_Network System Administration.pdf
Chapter-2-NSA_Network System Administration.pdf
AssefaSen
際際滷s: Eco Economic Epochs World Game's Great Redesign .pdf
際際滷s: Eco Economic Epochs World Game's Great Redesign .pdf際際滷s: Eco Economic Epochs World Game's Great Redesign .pdf
際際滷s: Eco Economic Epochs World Game's Great Redesign .pdf
Steven McGee
DB.pptx data base HNS level III 2017 yearx
DB.pptx data base HNS level III 2017 yearxDB.pptx data base HNS level III 2017 yearx
DB.pptx data base HNS level III 2017 yearx
kebimesay23
ESTUDO DO ARTIGO 22 AO 39 DO CDIGO CVIL.pdf
ESTUDO DO ARTIGO 22 AO 39 DO CDIGO CVIL.pdfESTUDO DO ARTIGO 22 AO 39 DO CDIGO CVIL.pdf
ESTUDO DO ARTIGO 22 AO 39 DO CDIGO CVIL.pdf
HELLEN CRISTINA

Introduction to mvc architecture

  • 2. INTRODUCTION TO MVC ASP.NET ARCHITECTURE ASP.NET MVC is a part of ASP.NET and not an entirely separate Framework. The Model-View-Controller (MVC) pattern is an architectural design principle that separates the components of a Web application. This separation gives you more control over the individual parts of the application, which lets you more easily develop, modify, and test them. ASP.NET MVC is part of the ASP.NET framework. Developing an ASP.NET MVC application is an alternative to developing ASP.NET Web Forms pages; it does not replace the Web Forms model. 2 QuicSolvTechnologiesPvt.Ltd.
  • 3. INTRODUCTION TO MVC ASP.NET ARCHITECTURE 3 QuicSolvTechnologiesPvt.Ltd.
  • 4. MODEL-VIEW-CONTROLLER Controller: - The controller is like a traffic cop. Whenever user requests any resource it first goes to the controller. Controller than interact with both the Model and View. Model: - The model is responsible for the data for the application and also it creates data for the view. It handles data processing and database works part. View: - It is a presentation layer i.e. it shows the data to the users. 4 QuicSolvTechnologiesPvt.Ltd.
  • 5. BASIC CONVENTIONS IN ASP.NET MVC There is single controller directory which holds your controller classes. Each controllers name ends with Controller e.g. : HomeController Views that controller use live in subdirectory of the Views main directory. Directory for above HomeController will be Views/Home All reusable UI elements live in similar structure above but in a Shared directory on Root. 5 QuicSolvTechnologiesPvt.Ltd.
  • 6. BASIC CONVENTIONS IN ASP.NET MVC Controller contains all Controller classes. Models contains all Models classes. Views contains associated views. Content contains all CSS / Images / other libraries Script contains default scripts loaded MVC 6 QuicSolvTechnologiesPvt.Ltd.
  • 7. 7 QuicSolvTechnologiesPvt.Ltd. ASP.NET WEB FORMS VS ASP.NET MVC ASP.NET WeB Form Does well with Abstraction Not fully Testable Not much HTML Expertise required Less maintainable Supported by heaps of third party Server side controls and tools. ASP.NET MVC Works with SoC principle Best for TDD HTML knowledge is required Highly maintainable Supported by various Third party JavaScript controls
  • 8. ASP.NET MVC VIEW ENGINE 8 QuicSolvTechnologiesPvt.Ltd. Types of View Engine System.Web.Mvc.WebFormViewEngine System.Web.Razor Bellevue Brail NDjango using the F# Many More.
  • 9. WHY VIEW ENGINES Syntax Skill set/background Productivity Testability View engines that dont depend on the System.Web.UI.Page are easier to test than the default ASP.NET MVC view engine, which uses Page for a base class of its view implementation. Division of labor If you have designers working on the views, or just want minimal logic in your views, you should choose a view engine that easily mixes with Html.
  • 10. Step 1 ASP.NET MVC REQUEST FLOW Incoming request directed to Controller Request Controller
  • 11. Step 2 ASP.NET MVC REQUEST FLOW Controller processes request and forms a data Model Request Controller Model
  • 12. ASP.NET MVC REQUEST FLOW Step 3 12 QuicSolvTechnologiesPvt.Ltd. Model is passed to View Request Controller Model View
  • 13. ASP.NET MVC REQUEST FLOW Step 4 13 QuicSolvTechnologiesPvt.Ltd. View transforms Model into appropriate output format Request Controller View Response
  • 14. ASP.NET MVC REQUEST LIFE CYCLE 14 QuicSolvTechnologiesPvt.Ltd.
  • 15. WHY MVC? It makes it easier to manage complexity by dividing an application into the model, the view, and the controller. It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application. It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure. For more information, see Front Controller. It provides better support for test-driven development (TDD). It works well for Web applications that are supported by large teams of developers and for Web designers who need a high degree of control over the application behavior. 15 QuicSolvTechnologiesPvt.Ltd.