|
|
Introduction to MVC Presented by Geethika
Introduction to MVC Architecture of MVC DEMO Conclusion Contents
MVC A design pattern Acronym for Model ● View ● Controller Separation of concerns
ASP.NET MVC A new Web Application Project type Simply an option Not a replacement for WebForms Builds on top ASP.NET Manual vs Automatic Transmission
MVC
A Little More Detail Browser requests /Products/ Route is determined Controller is activated Method on Controller is invoke Controller does some stuff Renders View, passing in custom ViewData URLs are rendered, pointing to other Controllers
MVC Step 1 Incoming request directed to Controller
MVC Step 2 Controller processes request and forms a data Model
MVC Step 3 Model is passed to View
MVC Step 4 View transforms Model into appropriate output format
MVC Step 5 Response is rendered
Even More Detail – Request Flow You can futz at each step in the process
Framework Goals Frictionless Testability Tight control over markup User/SEO friendly URLs Leverage the benefits of ASP.NET Conventions and Guidance
Separation Of Concerns Each component has one responsibility SRP – Single Responsibility Principle DRY – Don’t Repeat Yourelf More easily testable Helps with concurrent development
Extensible Replace any component of the system Interface-based architecture Very few sealed methods / classes Plays well with others
Providers still work Membership, Caching, Session, etc. Views leverage .aspx and .ascx But they don’t have to if you don’t want them to Within System.Web namespace Feature Sharing
REST-like Fits with the nature of the web MVC exposes the stateless nature of HTTP Friendlier to humans Friendlier to web crawlers Search engine optimization (SEO)
| URL: |
No comments posted yet
Comments