ASP.NET MVCfor Beginners Shravan Kumar Thomson Reuters
Walk Away Knowing Introduction to ASP.NET MVC Problems with ASP.NET
What is ASP.NET? One web application framework to rule them all… ASP.NET Caching Modules Globalization Pages Controls Master Pages Profile Roles Membership Intrinsics Handlers Etc...
ASP.NET WebForms Presentation ASP.NET CORE Runtime
Are you happy with ASP.NET?
WebForms is great, But it does have some weaknesses
No real role responsibility… Master Page Control Control UI Presentation Logic Business Logic Data Access Control Control Page Control Control Control Control Who does what? How and when?
Control abstractions can be negative…
It isn’t easy enoughto test UI Logic
How does ASP.NET MVC Differ? A new Web Application Project type Not a replacement for WebForms -Builds on top of ASP.NET Simply an another option
Now ASP.NET ASP.NET WebForms ASP.NET MVC Presentation ASP.NET CORE Runtime
What is MVC? A design pattern Separation of concerns Acronym for Model ● View ● Controller
Separation of Concerns
SRP – Single Responsibility Principle
DRY – Don’t Repeat Yourself
More easily testable (TDD) Helps with concurrent development
Framework Goals Frictionless Testability Tight control over <markup/> User/SEO friendly URLs Leverage the benefits of ASP.NET Conventions and Guidance
Clean URLs REST-like /products/update /blog/posts/2008/08/12/mvc-is-cool Friendlier to humans /product.aspx?categoryid=123 to become Becomes /products/kittens/ Friendlier to web crawlers Search engine optimization (SEO)
Extensible Replace any component of the system
Very few sealed methods / classes
Plays well with others
What is MVC? Controller Request Step 1 Incoming request routed to Controller
What is MVC? Controller Model Step 2 Controller processes request and creates presentation Model
What is MVC? Controller View Step 3 Model is passed to View
What is MVC? Controller View Step 4 View transforms Model into appropriate output format
What is MVC? Controller View Response Step 5 Response is rendered
DEMO – ASP.NET MVC
It’s Question Time!
Be well,and stay in email@example.comBlog: http://theshravan.netTwitter: techieshravan