0% found this document useful (0 votes)
59 views26 pages

Paul Litwin Paul Litwin Deep Training & Fred Hutchinson Cancer Research Center

This document summarizes a presentation about ASP.NET MVC given by Paul Litwin. It begins with Paul's background and credentials. It then discusses what ASP.NET MVC is, why the MVC pattern is used, and how to build an ASP.NET MVC application. Key points include that MVC separates an app into models, views, and controllers, and that it enables building testable, scalable apps compared to traditional Web Forms. The document provides guidance on choosing between MVC and Web Forms based on factors like preferences and project needs.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views26 pages

Paul Litwin Paul Litwin Deep Training & Fred Hutchinson Cancer Research Center

This document summarizes a presentation about ASP.NET MVC given by Paul Litwin. It begins with Paul's background and credentials. It then discusses what ASP.NET MVC is, why the MVC pattern is used, and how to build an ASP.NET MVC application. Key points include that MVC separates an app into models, views, and controllers, and that it enables building testable, scalable apps compared to traditional Web Forms. The document provides guidance on choosing between MVC and Web Forms based on factors like preferences and project needs.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

ASP.

NET MVC for Dummies


Paul Litwin
Deep Training &
Fred Hutchinson Cancer Research Center

paul@deeptraining.com
twitter.com/plitwin
Paul Litwin
• Developer
● Focus: ASP.NET, ASP, VB, C#, SQL Server, …
● MCSD
● Microsoft MVP
● Programming Manger with
Fred Hutchinson Cancer Research Center (Seattle)
• Co-Founder and Senior Trainer
● Deep Training
• www.deeptraining.com
• Conference Chair/Speaker
● Chair, Microsoft ASP.NET Connections
● Member INETA Speakers Bureau
• Author
● Author/co-author of a dozen books, including…
• ASP.NET for Developers
• Access Cookbook, 2nd edition
• Access 2002 Desktop/Enterprise Dev Handbook
• AppDev SQL Server 2005 Reporting Services Course
Updated Slides & Samples Download

• You can download them from:


● www.deeptraining.com/litwin
ASP.NET MVC for Dummies Agenda

• What?
● What is ASP.NET MVC?
• Why?
● Why can’t I just use Web Forms?
● Why use ASP.NET MVC?
• How?
● How does it work?
● Show me how to build an app using it.
ASP.NET MVC

What?
ASP.NET MVC

• A new way to build highly-testable apps on


top of the ASP.NET Framework
• An alternative to using RAD Web Forms
MVC Design Pattern
• Conery, Hanselman, Haack, Guthrie
define it as…
● An architectural pattern used to separate an
application into three main aspects
• Model. Set of classes that represent data and
business rules for how data can be changed and
manipulated
• View. Application’s user interface
• Controller. Set of classes that handles
communication from user, overall application flow,
and application-specific logic
ASP.NET MVC

• ASP.NET MVC 1.0


● Requires ASP.NET 3.5 / Visual Studio 2008 SP1
● Download Microsoft ASP.NET MVC 1.0 from
http://asp.net/mvc
● What we will use this session
• ASP.NET MVC 2.0
● In beta
● Will be part of Visual Studio 2010 / ASP.NET 4.0
ASP.NET MVC

Why?
Why Separate Concerns?

• Makes your app code more…


● testable
● modifable / refactorable
● reusable
● maintainable
● scalable
What’s Wrong with Web Forms?

• Nothing…but…
● Web forms don’t allow as precise control over
“separation of concerns”
● Web forms are difficult to test
● Search engine optimization (SEO) issues
What Web Forms & MVC Have in
Common
• Both hosted in Visual Studio
• Both run on IIS
• Both use .aspx pages
● Both can use Master pages
● though you can use a different view engine if
you’d like in MVC (NHaml, Spark, Brail,
NVelocity, etc.)
• Both can use any data access framework
(ADO.NET, LINQ, Entity Framework, etc.)
ASP.NET MVC

How?
Basic Tenets of ASP.NET MVC

• Convention over configuration


• Don’t repeat yourself (DRY)
• Pluggability whenever possible
• Try to be helpful, but get out of the
develper’s way
ASP.NET Project MVC Anatomy

• Models
• Controllers
• Views
• Shared
• Content
• Scripts
Building MVC Application Demo

• Rough steps we will follow


1. New ASP.NET MVC Project
2. Delete Home files
3. Add model using LINQ 2 SQL
4. Add repositories
5. Add HomeController
6. Create Views
7. Add support for drop-downs
8. Add validation support
9. Add unit tests
Summary

• How does MVC compare to Web Forms


development?
ASP.NET MVC Pluses (Why)

• A new way to build highly-testable apps on


top of the ASP.NET Framework
• No post-backs
• Requests map to methods rather than pages
• SEO-friendly URLs
• Supports TDD and Unit Tests
• Encourages use of design patterns and best
practices
ASP.NET MVC Minuses (Why Not)

• Not as RAD as using Web Forms


• No drag and drop experience
• Doesn’t build on all your experience with
ASP.NET server controls
• Encourages use of design patterns and
best practices
How Do I Decide Which to Use?

• Choose MVC if you…


● want to embrace design patterns and are
willing to put hard work into understanding
them
● are disciplined and want to follow design
patterns and best pratices
● are interested in embracing unit tests
● are interested in embracing TDD
● are being told to use it by your employer/client
How Do I Decide Which to Use?
• Choose Web Forms if you…
● you like Web Forms
● your brain hurts when reading about design
patterns
● you don’t like following patterns or best
pratices
● are not interested in embracing unit tests or
TDD
● are being told to use it by your employer/client
Another Way to Look At It…

• Building an intranet site with lots of data


editing
● Web Forms may be better suited
• Building an Internet site where HTML,
performance, and scalability are
paramount
● ASP.NET MVC may be better suited
Something to Consider…

• Once you start on MVC path, you will find you will
find yourself getting pulled in deeper and deeper…
● How do I write good unit tests with good coverage?
● Do you use a different View engine?
● Do you use a unit test framework
● Do you use a mock framework?
● What about validation framework?
● What about dependency injection, inversion of
control?
● …
What About Me?

• I am intrigued with ASP.NET MVC


• However…
● My brain does hurt when reading about
design patterns
● I love Web Forms
• OTOH…
● I like the idea of unit testing, maintainability,
and best practices
Learning Resources
• Bing/Google for Nerd Dinner MVC
● Chapter by Scott Guthrie
• ASP.NET MVC Framework Unleashed
● Walther
• Professional ASP.NET MVC 1.0
● Conery, Hanselman, Haack, Guthrie
• ASP.NET in Action
● Palermo, Scheirman, Bogard
• Head First Design Patterns
● Freeman & Freeman
Thank You!

•Please complete evaluation forms


•Contact: paul@deeptraining.com
•Download updated slides & samples from
●www.deeptraining.com/litwin

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy