Download presentation
Presentation is loading. Please wait.
Published byAlvin Gibson Modified over 9 years ago
1
Introducing ASP.NET MVC Alan Dean
2
Model-View-Controller (MVC) is a well-known design pattern The original 1978 implementation is described in depth in the influential 1992 paper “Applications Programming in Smalltalk-80: How to use Model-View-Controller (MVC)” by Steve Burbeck
3
…“the concept of the design pattern in software provides a key to helping developers leverage the expertise of other skilled architects.” Grady Booch, 1995
5
MVC consists of three kinds of objects The Model is the application object The View is the screen presentation The Controller defines the way the user interface reacts to user input
6
Before MVC, user interface designs tended to lump these objects together MVC decouples them to increase flexibility and reuse
7
Controller ModelView
8
In his paper Steve Burbeck describes two variations of MVC a passive model and an active model
9
The passive model is employed when one controller manipulates the model exclusively The controller modifies the model and then informs the view that the model has changed and should be refreshed The model in this scenario is completely independent of the view and the controller, which means that there is no means for the model to report changes in its state
10
ControllerViewModel handleEvent service update getData
11
The HTTP protocol is an example of this. The browser displays the view and responds to user input, but it does not detect changes in the data on the server. Only when the browser explicitly requests a refresh is the server interrogated for changes.
12
Separation of Concerns (SoC) Object types become ‘pluggable’ Intra-team dependency is reduced Testability is enhanced Application flow can be hard to grok
13
MVC Web Frameworks Java has Swing, Struts, Grails and others Perl has Catalyst, Gantry, Jifty and others PHP has Zend, Zoop, Agavi and others Python has Django, Gluon, Pylon and others Ruby on Rails is famously ‘opinionated’ … and.NET?
14
.NET MVC Web Frameworks Spring.NET http://www.springframework.net/ Maverick.NET http://mavnet.sourceforge.net/ MonoRail http://www.castleproject.org/monorail/ … and now ASP.NET MVC from Microsoft http://asp.net/downloads/3.5-extensions/
15
“The ASP.NET MVC framework is a lightweight, highly testable presentation framework that is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc namespace and is a fundamental, supported part of the System.Web namespace”
16
Wiki A wiki is software that allows users to create, edit, and link web pages easily
17
Ward Cunningham, developer of the first wiki, WikiWikiWeb, originally described it as "the simplest online database that could possibly work"
18
Wiki HTTP API GET / GET /page.html POST /page GET /page/[title] GET /page/[title].txt GET /page/[title].html GET /page/[title].atom PUT /page/[title] DELETE /page/[title]
19
GET The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. Safe & Idempotent
20
POST The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI
21
PUT The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. Idempotent
22
DELETE The DELETE method requests that the origin server delete the resource identified by the Request-URI. Idempotent
24
REpresentational State Transfer
25
REST: The Web Used Correctly A system or application architecture … that uses HTTP, URI and other Web standards “correctly” … is “on” the Web, not tunnelled through it
26
REST is an Architectural Style Defines a set of key “constraints” … that, if met, make an architecture “RESTful” … with the Web as one example
27
Equate “REST” with “RESTful HTTP usage” Stefan Tilkov
28
Deriving REST Client-Server Stateless Cache Uniform interface Layered system Code on Demand
29
“The central feature that distinguishes the REST architectural style from other network-based styles is its emphasis on a uniform interface between components.” Roy Fielding
30
Uniform Interface Uniform resource identification A set of well-defined operations for manipulation A shared set of media-types Hypertext as the engine of application state
31
Benefits of REST Hypertext is standardized fewer UIs Identification is standardized less communication Exchange protocols are standardized fewer integrations Interactions are standardized fewer semantics Data formats are standardized fewer translations
32
“No matter how hard I try, I still think the WS-* stack is bloated, opaque, and insanely complex. I think it is going to be hard to understand, hard to implement, hard to interoperate, and hard to secure.” Tim Bray (XML Co-inventor)
33
“If you’re ready for REST I suggest you jump on board right away and get ahead of the curve You’ll have to train your developers in REST principles. You definitely need to provide guidance to your people. What you want to do is work to the point where REST becomes the default for all your distributed applications.” Anne Thomas Manes (Burton Group)
35
Links http://del.icio.us/tag/aspnetmvc http://code.google.com/p/alan-dean/ http://code.google.com/p/altnetuk/ Email alan.dean@thoughtpad.net © MMVIII
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.