33
ASP.NET MVC Phil Haack Senior Program Manager Microsoft Corporation PC2 1

Phil Haack Senior Program Manager Microsoft Corporation PC21

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

ASP.NET MVC

Phil HaackSenior Program ManagerMicrosoft Corporation

PC21

Session Objective(s): Introduce the ASP.NET MVC feature Demonstrate App Building using ASP.NET MVC

Key Takeaways: ASP.NET MVC puts you in full

control of your application ASP.NET MVC is awesome

Session Objectives And Takeaways

Web 2.0

Why does it seem there are so

few built using ASP.NET

What is Web 2.0?

Marketing hot air?

Or are there some concrete characteristics?

A Randomly Selected Web 2.0 Website

demo

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 thus far. 6 releases! Community feedback via forums, 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?

Step 1Incoming request directed to Controller

Request

Controller

What is MVC?

Step 2Controller processes request and forms a data Model

Controller

Model

What is MVC?

Step 3Model is passed to View

Controller

View

What is MVC?

Step 4View transforms Model into appropriate output format

Controller

View

What is MVC?

Step 5Response is rendered

Response

Controller

View

“File | New”

demo

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

Let’s Build an Application!

demo

WebForms are great …

Mature, proven technology

Scalable

Extensible

Familiar feel to WinForms developers

… but they have challenges

Abstractions aren’t very abstract

Difficult to test

Lack of control over markup

It does things you didn’t tell it to do

StackOverflow.com

Jeff AtwoodCEOStack Overflow LLC

partner

Summary

Not a replacement for WebForms All about alternatives

Fundamental Part of the System.Web namespace Same team that builds WebForms

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

SummaryIt’s still ASP.NET

Replace Any Part with one of your own As simple or complex as it needs to be to

suit your tasks Plays well with others

Want to use NHibernate for models? OK! Want to use Brail for views? OK! Want to use VB for controllers? OK!

SummaryExtensible

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)

SummaryClean URL Structure

I’ll be at the PDC Lounge Tuesday, October 28 3:00 PM – 6:00 PM if you have more questions.

Breakout Sessions/Chalk Talks: PC30 – ASP.NET Dynamic Data PC31 – ASP.NET and Jquery PC32 – ASP.NET Ajax Futures PC33 – Microsoft Visual Studio: Easing ASP.NET Web PC41 – ASP.NET Cache Extensibility TL20 – EF Futures TL07 – Developing Applications using Data Services TL48 – Microsoft Visual Studio: Web Development

Futures ES15 – Deploying Web Applications with Microsoft IIS

7.0 and the Web Deployment Tool

Related content

For more information

Official sites Central landing site: http://asp.net/mvc Forums: http://forums.asp.net/1146.aspx

Source available! Source drop: http://codeplex.com/aspnet

Blogs http://haacked.com/ http://weblogs.asp.net/scottgu http://hanselman.com/ http://weblogs.asp.net/leftslipper/

Please use the microphones provided

Q&A

28

Evals & Recordings

Please fill

out your

evaluation for

this session at:

This session will be available as a recording at:

www.microsoftpdc.com

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market

conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Choosing Between The Two

Appendix

You want full control over markup You want a framework that enforces separation

of concerns TDD/Unit Testing is a priority for you Control abstractions get in your way more than

they help You like writing Javascript

You Might be an MVC if…With Apologies to Jeff Foxworthy

You like programming against the reusable control abstraction that encapsulate UI and logic

You like using the WYSWIG designer and would rather avoid angle brackets

You like keeping logic on the server rather than hand writing Javascript

Unit testing with the MVP pattern is sufficient for your needs

You Might be a WebForm if…With Apologies to Jeff Foxworthy