SlideShare a Scribd company logo
Introducing ASP.NET MVC Alan Dean, Senior Technologist
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
…“ the concept of the design pattern in software provides a key to helping developers leverage the expertise of other skilled architects.” Grady Booch, 1995
 
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
Before MVC, user interface designs tended to lump these objects together MVC decouples them to increase flexibility and reuse
Controller Model View
In his paper Steve Burbeck describes two variations of MVC a  passive  model and an active model
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
Controller View Model handleEvent service update getData
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.
Separation of Concerns (SoC) Object types become ‘pluggable’ Intra-team dependency is reduced Testability  is enhanced Application flow can be hard to grok
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?
.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/
“ 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”
Demo Create a new ASP.NET MVC Solution
HTTP Request Flow HTTP Response GET /Home/Index HTTP/1.1 HTTP Request Route Handler Controller Model View
HTTP Request Flow public class   Global  :  HttpApplication { protected void  Application_Start( object  sender,  EventArgs  e) { RouteTable .Routes.Add( new   Route { Url =  "[controller]/[action]/[id]" , Defaults =  new  { action =  "Index" , id = ( string ) null  }, RouteHandler =  typeof ( MvcRouteHandler ) }); } } HTTP Response Route Handler HTTP Request Controller Model View
HTTP Request Flow public class   HomeController  :  Controller { [ ControllerAction ] public void  Index() { CompanyInfo  companyInfo =  new   CompanyInfo (); companyInfo.CompanyName =  "Your company name here" ; RenderView( "Index" , companyInfo); } } HTTP Response Controller HTTP Request Route Handler Model View
HTTP Request Flow public class   CompanyInfo { public string  CompanyName {  get ;  set ; } } HTTP Response Model HTTP Request Route Handler Controller View
HTTP Request Flow public partial class   Index  :  ViewPage < CompanyInfo > { } Response View <% @  Page   Language =&quot;C#&quot;  AutoEventWireup =&quot;true&quot;  CodeBehind =&quot;Index.aspx.cs&quot;  Inherits =&quot;MvcApplication.Views.Home.Index&quot;  %> < html > < head > < title > <%= this.ViewData.companyName %> </ title > </ head > < body > <%= Html.ActionLink( “Homepage&quot; ,  &quot;Index&quot; ,  &quot;Home&quot; ) %> < div > Welcome! </ div > </ body > </ html > HTTP Request Route Handler Controller Model
HTTP Request Flow HTTP/1.1 200 OK Content-Type: text/html <html> <head> <title>Your company name here</title> </head> <body> <a href=&quot;/Home/Index&quot;>Index</a> <div>Welcome!</div> </body> </html> HTTP Request Route Handler Controller Model View HTTP Response
Wiki A wiki is software that allows users to create, edit, and link web pages easily
Ward Cunningham, developer of the first wiki,  WikiWikiWeb , originally described it as &quot;the simplest online database that could possibly work&quot;
Wiki Database CREATE TABLE  [dbo].[PageTable] ( [Id]  int IDENTITY (1,1)  NOT NULL , [Guid]  uniqueidentifier NOT NULL , [LastModified]  datetime NOT NULL , [Removed]  datetime NULL , [Title]  varchar (255)  NOT NULL , [Body]  ntext NOT NULL );
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]
GET The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. Safe  &  Idempotent
GET / Accept: text/html, */* 303 See Other Location: http://localhost/page.html Cache-Control: public Expires: Thu, 31 Jan 2008 16:00:00 GMT
GET /page.html Accept: text/html, */* 200 OK Content-Type: text/html Cache-Control: public Expires: Thu, 31 Jan 2008 16:00:00 GMT <html> <head><title>…</title></head> <body> <form action=&quot; /page &quot; method=&quot; post &quot; enctype=&quot; application/x-www-form-urlencoded &quot;> <input type=&quot;text&quot; name=&quot;title&quot; maxlength=&quot;255&quot; /> <textarea name=&quot;body&quot; rows=&quot;25&quot; cols=&quot;80&quot;></textarea> <input type=&quot;submit&quot; value=&quot;Create Page&quot; /> </form> </body> </html>
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
POST /page Content-Type: application/x-www-form-urlencoded title=Welcome&body=Welcome+to+my+new+wiki. 201 Created Content-Type: text/html Content-Location: http://localhost/page/Welcome Cache-Control: no-cache <html> <head> <title>…</title> <meta http-equiv=&quot; refresh &quot;   content=&quot;0;url= http://localhost:64701/page/Welcome &quot;> </head> <body>…</body> </html>
GET /page/Welcome Accept: text/html, */* 303 See Other Location: http://localhost/page/Welcome.html Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT Vary: Accept
GET /page/Welcome.html Accept: text/html, */* 200 OK Content-Type: text/html Content-Location: http://localhost/page/Welcome Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT <html> <head> <title>…</title> <link href=&quot; http://localhost/page/Welcome.atom &quot; rel=&quot; alternate &quot; title=&quot;…&quot; type=&quot; application/atom+xml &quot; /> </head> <body>…</body> </html>
GET /page/Welcome.atom Accept: application/atom+xml 200 OK Content-Type: application/atom+xml Content-Location: http://localhost/page/Welcome Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT <?xml version=&quot;1.0&quot; encoding=&quot;utf-8”?> <feed xml:lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/2005/Atom&quot;> … <link href=&quot; http://localhost:64701/page/Welcome &quot; rel=&quot; source &quot; /> <link href=&quot; http://localhost:64701/page/Welcome.atom &quot; rel=&quot; self &quot; type=&quot;application/atom+xml&quot; hreflang=&quot;en&quot; title=&quot;…&quot; /> <link href=&quot; http://localhost:64701/page/Welcome.html &quot; rel=&quot; alternate &quot; type=&quot;text/html&quot; hreflang=&quot;en&quot; title=&quot;…&quot; /> <link href=&quot; http://localhost:64701/page/Welcome.txt &quot; rel=&quot; alternate &quot; type=&quot;text/plain&quot; hreflang=&quot;en&quot; title=&quot;…&quot; /> <entry>…</entry> </feed>
GET /page/Welcome Accept: text/plain 303 See Other Location: http://localhost/page/Welcome.txt Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT Vary: Accept GET /page/Welcome.txt Accept: text/plain 200 OK Content-Type: text/plain Content-Location: http://localhost/page/Welcome Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT Welcome to my new wiki.
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
PUT /page/Welcome Content-Type: text/plain Welcome to my new [[wiki]]. 204 No Content Cache-Control: no-cache
DELETE The DELETE method requests that the origin server delete the resource identified by the Request-URI. Idempotent
DELETE /page/Welcome 204 No Content Cache-Control: no-cache
 
RE presentational  S tate  T ransfer
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
REST is an Architectural Style Defines a set of key “constraints” …  that, if met, make an architecture “RESTful” …  with the Web as one example
Equate “REST” with “RESTful HTTP usage” Stefan Tilkov
Deriving REST Client-Server Stateless Cache Uniform interface Layered system Code on Demand
“ 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
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
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
“ 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)
“ 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)
 
Links http://del.icio.us/alan.dean/mvc http://thoughtpad.net/alan-dean Email [email_address] © MMVIII

More Related Content

ODP
JSF 2.0 (JavaEE Webinar)
PPT
Java Server Faces (JSF) - advanced
PPT
ASP.NET MVC introduction
ODP
Wicket Next (1.4/1.5)
PPT
Unified Expression Language
PPT
Rich faces
PPTX
Migrating from JSF1 to JSF2
PDF
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
JSF 2.0 (JavaEE Webinar)
Java Server Faces (JSF) - advanced
ASP.NET MVC introduction
Wicket Next (1.4/1.5)
Unified Expression Language
Rich faces
Migrating from JSF1 to JSF2
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점

What's hot (20)

PDF
Intro to html 5
PPT
JSF Custom Components
PPT
What's new and exciting with JSF 2.0
PDF
Apache Wicket Web Framework
PPT
Seam Introduction
PDF
Web Components for Java Developers
PPTX
Servlet and jsp interview questions
ODP
Devoxx 09 (Belgium)
PDF
Vaadin Components @ Angular U
PPTX
The Django Web Application Framework 2
PDF
Vaadin Components
PDF
Introduction to HTML5
PPT
Processing XML with Java
PPS
Jsp element
PDF
Ajax Security
PPTX
MVC Frameworks for building PHP Web Applications
PDF
Polymer, A Web Component Polyfill Library
PPT
Boston Computing Review - Java Server Pages
PDF
The Structure of Web Code: A Case For Polymer, November 1, 2014
PDF
Portlet Specification 3.0 Is Here!
Intro to html 5
JSF Custom Components
What's new and exciting with JSF 2.0
Apache Wicket Web Framework
Seam Introduction
Web Components for Java Developers
Servlet and jsp interview questions
Devoxx 09 (Belgium)
Vaadin Components @ Angular U
The Django Web Application Framework 2
Vaadin Components
Introduction to HTML5
Processing XML with Java
Jsp element
Ajax Security
MVC Frameworks for building PHP Web Applications
Polymer, A Web Component Polyfill Library
Boston Computing Review - Java Server Pages
The Structure of Web Code: A Case For Polymer, November 1, 2014
Portlet Specification 3.0 Is Here!
Ad

Viewers also liked (12)

PPT
Introduction to ASP.NET MVC
PDF
How To Install ubuntu 12.04 version
PPTX
Understanding ASP.NET MVC
PDF
PhoneGap @ Javascript Directions
PPTX
Building a real time html5 app for mobile devices
PPTX
Lezione 1 - Teoria - Accenni sulle reti e sui servizi internet
PPTX
Rapid Prototyping with Cordova aka Phonegap
PDF
Ionic framework one day training
PDF
Building Mobile Apps with Cordova , AngularJS and Ionic
PDF
Building Mobile Applications with Ionic
PDF
Color your life: how to spice up your life with colors.
PPTX
Steve Jobs Inspirational Quotes
Introduction to ASP.NET MVC
How To Install ubuntu 12.04 version
Understanding ASP.NET MVC
PhoneGap @ Javascript Directions
Building a real time html5 app for mobile devices
Lezione 1 - Teoria - Accenni sulle reti e sui servizi internet
Rapid Prototyping with Cordova aka Phonegap
Ionic framework one day training
Building Mobile Apps with Cordova , AngularJS and Ionic
Building Mobile Applications with Ionic
Color your life: how to spice up your life with colors.
Steve Jobs Inspirational Quotes
Ad

Similar to Introduction To ASP.NET MVC (20)

PPTX
The Django Web Application Framework 2
PPTX
The Django Web Application Framework 2
PPTX
The Django Web Application Framework 2
PPT
Spring MVC
ODP
ActiveWeb: Chicago Java User Group Presentation
PPT
Ta Javaserverside Eran Toch
PPT
RESTful SOA - 中科院暑期讲座
PPT
Internet Explorer 8 for Developers by Christian Thilmany
ODP
Annotation-Based Spring Portlet MVC
PPT
Introduction to ASP.NET MVC
PDF
Intro To Mvc Development In Php
PDF
Front End Development for Back End Developers - UberConf 2017
PPTX
ASP.NET MVC
PPTX
Entity framework and how to use it
PDF
Front End Development for Back End Developers - vJUG24 2017
PPT
EPiServer Web Parts
PPTX
Spring Surf 101
PPT
Create a web-app with Cgi Appplication
PPTX
SgCodeJam24 Workshop Extract
PPT
JSP diana y yo
The Django Web Application Framework 2
The Django Web Application Framework 2
The Django Web Application Framework 2
Spring MVC
ActiveWeb: Chicago Java User Group Presentation
Ta Javaserverside Eran Toch
RESTful SOA - 中科院暑期讲座
Internet Explorer 8 for Developers by Christian Thilmany
Annotation-Based Spring Portlet MVC
Introduction to ASP.NET MVC
Intro To Mvc Development In Php
Front End Development for Back End Developers - UberConf 2017
ASP.NET MVC
Entity framework and how to use it
Front End Development for Back End Developers - vJUG24 2017
EPiServer Web Parts
Spring Surf 101
Create a web-app with Cgi Appplication
SgCodeJam24 Workshop Extract
JSP diana y yo

More from Alan Dean (8)

PDF
Cavity Data
PPTX
Test Driven Development (C#)
PPTX
Test Driven Development (Delphi)
PPTX
Azure, Cloud Computing & Services
PPT
Separating REST Facts from Fallacies
PDF
Future Direction For Agile
PPT
Object Thinking
PPT
Internationalisation And Globalisation
Cavity Data
Test Driven Development (C#)
Test Driven Development (Delphi)
Azure, Cloud Computing & Services
Separating REST Facts from Fallacies
Future Direction For Agile
Object Thinking
Internationalisation And Globalisation

Recently uploaded (20)

PDF
A Brief Introduction About Julia Allison
PDF
The FMS General Management Prep-Book 2025.pdf
PDF
Unit 1 Cost Accounting - Cost sheet
PPTX
Belch_12e_PPT_Ch18_Accessible_university.pptx
PDF
KornFerry Presentation hbkjbkjbk bjkbkbk.pdf
PDF
DOC-20250806-WA0002._20250806_112011_0000.pdf
DOCX
Business Management - unit 1 and 2
PPTX
Amazon (Business Studies) management studies
PPT
Chapter four Project-Preparation material
PDF
TriStar Gold Corporate Presentation August 2025
PPTX
5 Stages of group development guide.pptx
DOCX
unit 1 COST ACCOUNTING AND COST SHEET
DOCX
Euro SEO Services 1st 3 General Updates.docx
PPTX
HR Introduction Slide (1).pptx on hr intro
PPTX
New Microsoft PowerPoint Presentation - Copy.pptx
PDF
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
PDF
Types of control:Qualitative vs Quantitative
PDF
A Brief Introduction About - Stacey Soans
PPT
Data mining for business intelligence ch04 sharda
PDF
Leading with Vision_ How Mohit Bansal Is Shaping Chandigarh’s Real Estate Ren...
A Brief Introduction About Julia Allison
The FMS General Management Prep-Book 2025.pdf
Unit 1 Cost Accounting - Cost sheet
Belch_12e_PPT_Ch18_Accessible_university.pptx
KornFerry Presentation hbkjbkjbk bjkbkbk.pdf
DOC-20250806-WA0002._20250806_112011_0000.pdf
Business Management - unit 1 and 2
Amazon (Business Studies) management studies
Chapter four Project-Preparation material
TriStar Gold Corporate Presentation August 2025
5 Stages of group development guide.pptx
unit 1 COST ACCOUNTING AND COST SHEET
Euro SEO Services 1st 3 General Updates.docx
HR Introduction Slide (1).pptx on hr intro
New Microsoft PowerPoint Presentation - Copy.pptx
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
Types of control:Qualitative vs Quantitative
A Brief Introduction About - Stacey Soans
Data mining for business intelligence ch04 sharda
Leading with Vision_ How Mohit Bansal Is Shaping Chandigarh’s Real Estate Ren...

Introduction To ASP.NET MVC

  • 1. Introducing ASP.NET MVC Alan Dean, Senior Technologist
  • 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
  • 4.  
  • 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
  • 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. Controller View Model 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. Demo Create a new ASP.NET MVC Solution
  • 17. HTTP Request Flow HTTP Response GET /Home/Index HTTP/1.1 HTTP Request Route Handler Controller Model View
  • 18. HTTP Request Flow public class Global : HttpApplication { protected void Application_Start( object sender, EventArgs e) { RouteTable .Routes.Add( new Route { Url = &quot;[controller]/[action]/[id]&quot; , Defaults = new { action = &quot;Index&quot; , id = ( string ) null }, RouteHandler = typeof ( MvcRouteHandler ) }); } } HTTP Response Route Handler HTTP Request Controller Model View
  • 19. HTTP Request Flow public class HomeController : Controller { [ ControllerAction ] public void Index() { CompanyInfo companyInfo = new CompanyInfo (); companyInfo.CompanyName = &quot;Your company name here&quot; ; RenderView( &quot;Index&quot; , companyInfo); } } HTTP Response Controller HTTP Request Route Handler Model View
  • 20. HTTP Request Flow public class CompanyInfo { public string CompanyName { get ; set ; } } HTTP Response Model HTTP Request Route Handler Controller View
  • 21. HTTP Request Flow public partial class Index : ViewPage < CompanyInfo > { } Response View <% @ Page Language =&quot;C#&quot; AutoEventWireup =&quot;true&quot; CodeBehind =&quot;Index.aspx.cs&quot; Inherits =&quot;MvcApplication.Views.Home.Index&quot; %> < html > < head > < title > <%= this.ViewData.companyName %> </ title > </ head > < body > <%= Html.ActionLink( “Homepage&quot; , &quot;Index&quot; , &quot;Home&quot; ) %> < div > Welcome! </ div > </ body > </ html > HTTP Request Route Handler Controller Model
  • 22. HTTP Request Flow HTTP/1.1 200 OK Content-Type: text/html <html> <head> <title>Your company name here</title> </head> <body> <a href=&quot;/Home/Index&quot;>Index</a> <div>Welcome!</div> </body> </html> HTTP Request Route Handler Controller Model View HTTP Response
  • 23. Wiki A wiki is software that allows users to create, edit, and link web pages easily
  • 24. Ward Cunningham, developer of the first wiki, WikiWikiWeb , originally described it as &quot;the simplest online database that could possibly work&quot;
  • 25. Wiki Database CREATE TABLE [dbo].[PageTable] ( [Id] int IDENTITY (1,1) NOT NULL , [Guid] uniqueidentifier NOT NULL , [LastModified] datetime NOT NULL , [Removed] datetime NULL , [Title] varchar (255) NOT NULL , [Body] ntext NOT NULL );
  • 26. 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]
  • 27. GET The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. Safe & Idempotent
  • 28. GET / Accept: text/html, */* 303 See Other Location: http://localhost/page.html Cache-Control: public Expires: Thu, 31 Jan 2008 16:00:00 GMT
  • 29. GET /page.html Accept: text/html, */* 200 OK Content-Type: text/html Cache-Control: public Expires: Thu, 31 Jan 2008 16:00:00 GMT <html> <head><title>…</title></head> <body> <form action=&quot; /page &quot; method=&quot; post &quot; enctype=&quot; application/x-www-form-urlencoded &quot;> <input type=&quot;text&quot; name=&quot;title&quot; maxlength=&quot;255&quot; /> <textarea name=&quot;body&quot; rows=&quot;25&quot; cols=&quot;80&quot;></textarea> <input type=&quot;submit&quot; value=&quot;Create Page&quot; /> </form> </body> </html>
  • 30. 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
  • 31. POST /page Content-Type: application/x-www-form-urlencoded title=Welcome&body=Welcome+to+my+new+wiki. 201 Created Content-Type: text/html Content-Location: http://localhost/page/Welcome Cache-Control: no-cache <html> <head> <title>…</title> <meta http-equiv=&quot; refresh &quot; content=&quot;0;url= http://localhost:64701/page/Welcome &quot;> </head> <body>…</body> </html>
  • 32. GET /page/Welcome Accept: text/html, */* 303 See Other Location: http://localhost/page/Welcome.html Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT Vary: Accept
  • 33. GET /page/Welcome.html Accept: text/html, */* 200 OK Content-Type: text/html Content-Location: http://localhost/page/Welcome Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT <html> <head> <title>…</title> <link href=&quot; http://localhost/page/Welcome.atom &quot; rel=&quot; alternate &quot; title=&quot;…&quot; type=&quot; application/atom+xml &quot; /> </head> <body>…</body> </html>
  • 34. GET /page/Welcome.atom Accept: application/atom+xml 200 OK Content-Type: application/atom+xml Content-Location: http://localhost/page/Welcome Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT <?xml version=&quot;1.0&quot; encoding=&quot;utf-8”?> <feed xml:lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/2005/Atom&quot;> … <link href=&quot; http://localhost:64701/page/Welcome &quot; rel=&quot; source &quot; /> <link href=&quot; http://localhost:64701/page/Welcome.atom &quot; rel=&quot; self &quot; type=&quot;application/atom+xml&quot; hreflang=&quot;en&quot; title=&quot;…&quot; /> <link href=&quot; http://localhost:64701/page/Welcome.html &quot; rel=&quot; alternate &quot; type=&quot;text/html&quot; hreflang=&quot;en&quot; title=&quot;…&quot; /> <link href=&quot; http://localhost:64701/page/Welcome.txt &quot; rel=&quot; alternate &quot; type=&quot;text/plain&quot; hreflang=&quot;en&quot; title=&quot;…&quot; /> <entry>…</entry> </feed>
  • 35. GET /page/Welcome Accept: text/plain 303 See Other Location: http://localhost/page/Welcome.txt Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT Vary: Accept GET /page/Welcome.txt Accept: text/plain 200 OK Content-Type: text/plain Content-Location: http://localhost/page/Welcome Cache-Control: public Last-Modified: Tue, 29 Jan 2008 16:00:00 GMT Welcome to my new wiki.
  • 36. 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
  • 37. PUT /page/Welcome Content-Type: text/plain Welcome to my new [[wiki]]. 204 No Content Cache-Control: no-cache
  • 38. DELETE The DELETE method requests that the origin server delete the resource identified by the Request-URI. Idempotent
  • 39. DELETE /page/Welcome 204 No Content Cache-Control: no-cache
  • 40.  
  • 41. RE presentational S tate T ransfer
  • 42. 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
  • 43. REST is an Architectural Style Defines a set of key “constraints” … that, if met, make an architecture “RESTful” … with the Web as one example
  • 44. Equate “REST” with “RESTful HTTP usage” Stefan Tilkov
  • 45. Deriving REST Client-Server Stateless Cache Uniform interface Layered system Code on Demand
  • 46. “ 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
  • 47. 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
  • 48. 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
  • 49. “ 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)
  • 50. “ 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)
  • 51.