ASP.NET MVC for smart people
Document Sample


ASP.NET MVC For Smart People
Scott Galloway, Program Manager, ASP.NET
Microsoft Corporation
scottgal@microsoft.com
http://www.mostlylucid.net
http://www.twitter.com/scottgal
What is 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
How was it developed?
• Transparently
• Regular source code releases on CodePlex
• Previews 1 – 5, Beta, RC1, RC2. 8 releases!
• Community feedback via forums,
StackOverflow, etc…
• Agilely
• 94% Code Coverage/1051 unit tests
• Daily Triage Meetings and weekly design
meetings
• Small agile team
What is MVC?
• A design pattern
• Acronym for
Model ● View ● Controller
• Separation of concerns
What is MVC?
Controller
Request
Step 1
Incoming request directed to Controller
What is MVC?
Controller
Model
Step 2
Controller processes request and forms a data 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
File->New
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 Yourself
• 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
WebForms are great …
• Mature, proven technology
• Huge Third Party Control Ecosystem
• Scalable
• Extensible
• Familiar feel to WinForms developers
… they have problems
• Abstractions aren’t very abstract
• Difficult to test
• Lack of control over markup
• It does things you didn’t tell it to do
Demo
A real app (kind of)
Resources
• Phil Haack’s blog: www.haacked.com
• ASP.NET MVC Site: www.asp.net/mvc
• Scott Guthrie’s blog:
weblogs.asp.net/scottgu
• Rob Conery’s blog: blog.wekeroad.com/
Get documents about "