Introduction to ASP.NET MVC 1.0
Upcoming SlideShare
Loading in...5
×
 

Introduction to ASP.NET MVC 1.0

on

  • 2,839 views

Introduction to ASP.NET MVC 1.0

Introduction to ASP.NET MVC 1.0

Statistics

Views

Total Views
2,839
Views on SlideShare
2,820
Embed Views
19

Actions

Likes
1
Downloads
107
Comments
0

3 Embeds 19

http://www.linkedin.com 16
https://www.linkedin.com 2
http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Introduction to ASP.NET MVC 1.0 Introduction to ASP.NET MVC 1.0 Presentation Transcript

  • Shiju Varghese http://weblogs.asp.net/shijuvarghese
  • Session Objectives
    • Introduction to ASP.NET MVC
    • Demonstrate programming using ASP.NET MVC
  • What’s wrong with ASP.NET WebForm
    • ViewState
    • Page life cycle
    • Limited control over rendered HTML
    • Lack of Separation of Concerns (SoC)
    • Untestable
  • What is MVC
    • A design pattern
    • Acronym for Model View Controller
    • Isolating business logic from UI
    • Layering for UI layer
    • Separation of Concerns (SoC)
      • Separate content from presentation and data-processing (model) from content
  • What is MVC
    • View is just concerned about presentation logic
    • Models represent the data
    • Controllers just handle application flow
    • You write less code and end up with a more maintainable application.
  • Why a new model
    • A lot of developers asking for it.
      • Simpler way to program ASP.NET
      • Enable separation of concerns and testability
      • Model-view-controller presentation pattern is a time-tested pattern that scales with size and complexity
      • Complete control over Html generated
  • What is ASP.NET MVC
    • An alternative framework to ASP.NET Web Forms.
    • More control over your HTML
    • A more easily testable framework
    • Simply an option
      • Will not a replacement for Web Form
      • Build on top of ASP.NET
    • Opinionated Framework
      • Community Driven Framework
      • Source code on CodePlex
  • Goals of ASP.NET MVC Framework
    • Enable clean separation of concerns
      • Each component has one responsibility
        • Single Responsibility Principle (SRP)
        • Highly testable and maintainable application
    • Testable by default (built with TDD in mind)
      • Red/Green/Refactor TDD
    • Enable full control over the rendered HTML
    • Enable clean URLs and HTML
      • SEO and REST friendly URL structures
  • Goals of ASP.NET MVC Framework
    • Extensible and Pluggable framework.
      • Interface-based architecture
      • Support replacing any component of the system
      • Support third-party view engines such as NVelocity, Brail, NHaml
      • Support user-provided front controller that enable Inversion of Control containers
    • Build on top of ASP.NET
    • Support static and dynamic languages
    • Conventions and Guidance
  • ASP.NET MVC doesn’t have
    • Postbacks
    • View state
    • Control state
    • Server-side form
    • Page/Control lifecycle
  • ASP.NET MVC still has…
    • Web designer
    • Master pages
    • User controls
    • Membership/Roles/Profile
    • Globalization
    • Caching
    • HTTP intrinsics objects
  • URL Routing
    • Browser Request is mapped to controller action through URL Routing. URL Routing route the incoming requests to controller actions.
    • URL Routing uses Route Table that will be created when application first starts.
    • Route table is setup in the Global.asax file.
  • URL Routing
  • How it works Browser List.aspx (View) Web Server CategoryController (Controller) http://myserver.com/category/List http://myserver.com/category/Edit/5 Edit.aspx (View) Database Employeee (Model)
  • Request Flow
    • Browser requests /Category/
    • Route is determined
    • Controller is activated
    • Method on Controller is invoke
    • Controller does some stuff
    • Renders View, passing in custom ViewData
  • Request Flow
  • Summary
    • Not a replacement for WebForm
      • Just an alternative option
      • Not for everyone
    • Build on top of ASP.NET
      • Providers still work
        • Membership, Caching, Session
      • Views leverage .aspx and .acx
  • Summary – Extensible Framework
    • Replace any part with your own
    • All are pluggable
      • Views
      • Controllers
      • Models
      • Routes
  • Summary - Clean URL Structure
    • REST based Architecture
    • Fits with the nature of the Web
      • ASP.NET MVC exposes the stateless nature of HTTP
    • Search Engine Optimization (SEO)
  • Showcase of live ASP.NET MVC application
    • http:// stackoverflow.com /
      • A Web 2.0 application
      • Q & A website for developers
      • Blend of Wikis, Blogs, Forums, and Digg/Reddit
    • Oxite
      • Microsoft’s open source platform for CMS/Blog
      • Used to develop MIX Online ( http://visitmix.com )
  • ASP.NET MVC Versus WebForm
    • Web Form
      • Big Design Up Front (BDUF) methodology
      • RAD and WinForm programming experience
    • MVC
      • Not doing Big Design Up Front (BDUF)
      • “ Close to the Metal” Programming Experience
  • ASP.NET MVC Versus WebForm
    • Web Forms
      • ViewState, Page Execution Lifecycle, Postback Services
      • Not Easy to Test
      • Not Easy to Search (SEO)
    • MVC
      • No ViewState, Page Execution Lifecycle, Postback Services
      • Highly Testable
      • Easy Search (SEO)
  • Consider MVC model, If
    • You want full control over HTML
    • You want a framework that enforces separation of concerns
    • TDD/Unit Testing is priority for you
    • Control abstractions get in your way more than they help
    • You want easy integration with JavaScript
  • Consider WebForms model, If
    • You want programming against the reusable control abstractions that encapsulate UI and logic
    • You want RAD and Windows Form development experience
    • You want to develop heavy data-driven Line of Business (LOB) Applications.
  • You must use MVC model, If
    • You want adopt agile methodology
    • You are a DDD/TDD believer
    • You want to develop public face internet applications and Web 2.0 applications
  • Resources
    • ASP.NET MVC site - http:// as.net/mvc
    • Blogs
    • Scott Guthrie
    • http:// weblogs.asp.net/scottgu
    • Phill Haack
    • http:// haacked.com
    • Stephen Walther
    • http:// weblogs.asp.net/stephenwalther
  • Questions?
  • Thanks Shiju Varghese E-Mail : [email_address] Blog : http:// weblogs.asp.net/shijuvarghese Twitter : http:// twitter.com/shijucv