introduction to asp.net mvc 4.0 framework

25
MVC 4.0

Upload: apex-tgi

Post on 28-Jul-2015

128 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Introduction to asp.net mvc 4.0 framework

MVC 4.0

Page 2: Introduction to asp.net mvc 4.0 framework

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

Key Takeaways:ASP.NET MVC puts you in full

control of your applicationASP.NET MVC is awesome

Session Objectives And Takeaways

Page 3: Introduction to asp.net mvc 4.0 framework

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?

Page 4: Introduction to asp.net mvc 4.0 framework

What is ASP.NET MVC?

A new Web Application Project type

Simply an optionNot a replacement for WebForms

Builds on top ASP.NET

Manual vs Automatic Transmission

Page 5: Introduction to asp.net mvc 4.0 framework

How was it developed?

TransparentlyRegular source code releases on CodePlexPreviews 1 – 5, Beta thus far. 6 releases!Community feedback via forums, etc…

Agilely94% Code Coverage/1051 unit testsDaily Triage Meetings and weekly design

meetingsSmall agile team

Page 6: Introduction to asp.net mvc 4.0 framework

What is MVC?

A design pattern

Acronym for Model ● View ● Controller

Separation of concerns

Page 7: Introduction to asp.net mvc 4.0 framework

What is MVC?

Step 1Incoming request directed to Controller

Request

Controller

Page 8: Introduction to asp.net mvc 4.0 framework

What is MVC?

Step 2Controller processes request and forms a data Model

Controller

Model

Page 9: Introduction to asp.net mvc 4.0 framework

What is MVC?

Step 3Model is passed to View

Controller

View

Page 10: Introduction to asp.net mvc 4.0 framework

What is MVC?

Step 4View transforms Model into appropriate output format

Controller

View

Page 11: Introduction to asp.net mvc 4.0 framework

What is MVC?

Step 5Response is rendered

Response

Controller

View

Page 12: Introduction to asp.net mvc 4.0 framework

Framework Goals

Frictionless Testability

Tight control over markup

User/SEO friendly URLs

Leverage the benefits of ASP.NET

Conventions and Guidance

Page 13: Introduction to asp.net mvc 4.0 framework

Separation Of Concerns

Each component has one responsibilitySRP – Single Responsibility Principle

DRY – Don’t Repeat Yourelf

More easily testable

Helps with concurrent development

Page 14: Introduction to asp.net mvc 4.0 framework

Extensible

Replace any component of the systemInterface-based architecture

Very few sealed methods / classes

Plays well with others

Page 15: Introduction to asp.net mvc 4.0 framework

WebForms are great …

Mature, proven technology

Scalable

Extensible

Familiar feel to WinForms developers

Page 16: Introduction to asp.net mvc 4.0 framework

… 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

Page 17: Introduction to asp.net mvc 4.0 framework

Summary

Not a replacement for WebFormsAll about alternatives

FundamentalPart of the System.Web namespaceSame team that builds WebForms

Page 18: Introduction to asp.net mvc 4.0 framework

Providers still workMembership, Caching, Session, etc.

Views leverage .aspx and .ascxBut they don’t have to if you don’t want them to

Within System.Web namespaceFeature Sharing

SummaryIt’s still ASP.NET

Page 19: Introduction to asp.net mvc 4.0 framework

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

suit your tasksPlays 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

Page 20: Introduction to asp.net mvc 4.0 framework

REST-likeFits with the nature of the web

MVC exposes the stateless nature of HTTPFriendlier to humansFriendlier to web crawlers

Search engine optimization (SEO)

SummaryClean URL Structure

Page 21: Introduction to asp.net mvc 4.0 framework

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 DataPC31 – ASP.NET and JqueryPC32 – ASP.NET Ajax FuturesPC33 – Microsoft Visual Studio: Easing ASP.NET Web PC41 – ASP.NET Cache ExtensibilityTL20 – EF FuturesTL07 – Developing Applications using Data ServicesTL48 – Microsoft Visual Studio: Web Development FuturesES15 – Deploying Web Applications with Microsoft IIS 7.0

and the Web Deployment Tool

Related content

Page 22: Introduction to asp.net mvc 4.0 framework

Choosing Between The Two

Appendix

Page 23: Introduction to asp.net mvc 4.0 framework

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

of concernsTDD/Unit Testing is a priority for youControl abstractions get in your way more than

they helpYou like writing Javascript

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

Page 24: Introduction to asp.net mvc 4.0 framework

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

Page 25: Introduction to asp.net mvc 4.0 framework