introduction to asp.net mvc 4.0 framework
Post on 28-Jul-2015
124 Views
Preview:
TRANSCRIPT
MVC 4.0
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
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?
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
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
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
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 responsibilitySRP – Single Responsibility Principle
DRY – Don’t Repeat Yourelf
More easily testable
Helps with concurrent development
Extensible
Replace any component of the systemInterface-based architecture
Very few sealed methods / classes
Plays well with others
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
Summary
Not a replacement for WebFormsAll about alternatives
FundamentalPart of the System.Web namespaceSame team that builds WebForms
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
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
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
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
Choosing Between The Two
Appendix
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
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
top related