<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: soa-rest-icwe2009.xml 1036 2009-06-23 13:39:53Z dret $ -->
<?hotspot layout-path="hotspot/hotspot/layout" ?>
<?hotspot kilauea-path="hotspot/kilauea" ?>
<?hotspot layout="ischool+usi" ?>
<hotspot xmlns="http://dret.net/xmlns/hotspot/1" xmlns:hotspot="http://dret.net/xmlns/hotspot/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://dret.net/xmlns/hotspot/1 hotspot/hotspot/schemas/hotspot.xsd">
    <configuration>
		<link subsections="yes" bookmarks="yes" versions="soa-rest-icwe2009.xml" home="./" help="quick" contents="./" glossary="http://dret.net/glossary/" author="http://dret.net/netdret/"/>
		<paths img="img" listing="src"/>
		<outline count-text=" [*]" count-depth="all"/>
		<hyperlink extra=""/>
		<extension file="html" link=""/>
		<counter separator=":&#160;"/>
	</configuration>
	<license uri="http://creativecommons.org/licenses/by/3.0/" short="CC 3.0">
		<div class="license">
			<p><a rel="license" title="view full text of license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" src="hotspot/hotspot/layout/iSchool/iSchool/somerights20.png" border="0" height="31" width="88"/></a></p>
			<p><a class="outlink" rel="license" title="view full text of license" href="http://creativecommons.org/licenses/by/3.0/">This work is licensed under a CC<br/>Attribution 3.0 Unported License</a></p>
		</div>
	</license>
	<title short="From SOA to REST"><a href="./" title="Tutorial Homepage">From SOA to REST:<br/>Designing and Implementing RESTful Services</a><br/>Tutorial at <a href="http://icwe2009.webengineering.org/">ICWE 2009</a> (San Sebastián, Spain)</title>
	<author><a href="http://www.pautasso.info/">Cesare Pautasso</a></author>
	<affiliation><a href="http://www.inf.unisi.ch/">Faculty of Informatics</a>, <a href="http://www.unisi.ch/">University of Lugano</a></affiliation>
	<author><a href="http://dret.net/netdret/">Erik Wilde</a></author>
	<affiliation><a href="http://ischool.berkeley.edu/" title="ISchool">School of Information</a>, <a href="http://www.berkeley.edu/" title="University of California, Berkeley">UC Berkeley</a></affiliation>
	<date short="2009-06-22">June 22, 2009</date>
	<copyright>2009 Cesare Pautasso and Erik Wilde</copyright>
	<categories>
		<category element="xml" class="xml" name="XML"/>
		<category element="elem" class="xml elem" name="XML Element"/>
		<category element="html" class="html" name="HTML"/>
		<category element="htmla" class="html" name="HTML Attribute"/>
		<category element="htmel" class="html elem" name="HTML Element"/>
		<category element="cssp" class="css" name="CSS Property"/>
		<category element="csss" class="css" name="CSS Selector"/>
		<category element="css" class="css" name="CSS"/>
		<category element="xpathf" class="xpath" name="XPath Function"/>
		<category element="xpath" class="xpath" name="XPath"/>
		<category element="xslte" class="xslt elem" name="XSLT Element"/>
		<category element="xslta" class="xslt" name="XSLT Attribute"/>
		<category element="xslt" class="xslt" name="XSLT"/>
		<category element="xsde" class="xsd elem" name="XSD Element"/>
		<category element="xsda" class="xsd" name="XSD Attribute"/>
		<category element="xsd" class="xsd" name="XSD"/>
		<category element="uri" class="uri" name="URI"/>
		<category element="http" class="http" name="HTTP"/>
		<category element="mime" class="mime" name="MIME"/>
		<category element="atom" class="atom" name="Atom"/>
		<category element="atompub" class="atom" name="AtomPub"/>
	</categories>
    <toc name="toc.html">
		<table xmlns="" rules="all" cellspacing="0" cellpadding="5" width="100%">
		<!-- xmlns="" makes sure the document can be included into a web page setting xmlns to the HTML namespace. -->
			<thead>
				<tr>
					<th valign="bottom">Presenter</th>
					<th valign="bottom">Subject</th>
					<th valign="bottom">Slides</th>
					<th valign="bottom">Additional Resources</th>
				</tr>
			</thead>
			<tbody>
				 <hotspot:for-each-presentation>
					<tr>
						<td align="center" valign="middle"><hotspot:for-each-author><hotspot:author/><br/></hotspot:for-each-author></td>
						<td valign="top"><b><hotspot:title/>:</b> <span class="abstract"><hotspot:toc class="abstract"/></span></td>
						<td align="center"><hotspot:presentation-link title="Lecture Slides"><hotspot:title form="short"/></hotspot:presentation-link> <hotspot:toc class="notes"/></td>
						<td align="center"><hotspot:toc class="resources"/></td>
					</tr>
				</hotspot:for-each-presentation>
			</tbody>
		</table>
	</toc>
	<presentation id="intro">
		<title>Introduction</title>
		<author><a href="http://www.pautasso.info/">Cesare Pautasso</a></author>
		<affiliation><a href="http://www.inf.unisi.ch/">Faculty of Informatics</a>, <a href="http://www.unisi.ch/">University of Lugano</a></affiliation>
		<author><a href="http://dret.net/netdret/">Erik Wilde</a></author>
		<affiliation><a href="http://ischool.berkeley.edu/" title="ISchool">School of Information</a>, <a href="http://www.berkeley.edu/" title="University of California, Berkeley">UC Berkeley</a></affiliation>
		<toc class="notes">(<a href="intro.pdf" title="PDF Version">PDF</a>)</toc>
        <toc class="resources"><a href="http://dret.net/biblio/reference/pau09a" title="Cesare Pautasso and Erik Wilde, 'Why is the Web Loosely Coupled? A Multi-Faceted Metric for Service Design', Proceedings of the 18th International World Wide Web Conference, ACM Press, Madrid, Spain, April 2009">Loose&#160;Coupling</a></toc>
		<toc class="abstract">This introduction presents the schedule, the tutorial presenters, and some background for the tutorial. Specifically, we briefly mention all the *OA terms that have been invented in recent years, such as <em>SOA (Services)</em>, <em>ROA (Resources)</em>, <em>WOA (Web)</em>, <em>SynOA (Syndication)</em>, and <em>EOA (Event)</em>, and set them into context. Our main goal is to explain our notion of SOA for the purpose of this tutorial, and what we perceive as the core tasks when moving from SOA to REST.</toc>
		<slide>
			<title>Abstract</title>
			<p class="abstract"><toc class="abstract"/></p>
		</slide>
		<slide>
			<title>Schedule</title>
			<ul>
				<li>9.00-10.30: Intro &amp; <link href="rest"/></li>
				<li>11.00-12.30: <link href="design"/></li>
				<li>14.30-16.00: <link href="rest-ws"/></li>
				<li>16.30-18.00: <link href="practice"/></li>
			</ul>
		</slide>
		<part id="presenters">
			<title>Presenters</title>
			<slide>
				<title>Cesare Pautasso</title>
				<img src="usi-complete.png" style="float : right ; width : 25% ; margin-top : 0.5em ; margin-right : 2em ; "/>
				<ul>
					<li>Computer Science at <a href="http://www.polimi.it">Politecnico di Milano, Italy</a></li>
					<li>Ph.D. at <a href="http://www.ethz.ch/index_EN">ETH Zürich</a> (2004)</li>
					<li>Post-Doc at <a href="http://www.iks.inf.ethz.ch/">ETH Zürich</a></li>
					<ul>
						<li>Software: <a href="http://www.jopera.org">JOpera: Process Support for more than Web services</a></li>
					</ul>
					<li>Researcher at <a href="http://www.zurich.ibm.com">IBM Zurich Research Lab</a> (2007)</li>
					<li>Assistant Professor at the <a href="http://www.inf.unisi.ch/">Faculty of Informatics</a> (since September 2007)</li>
					<li>Representations: <a href="http://www.pautasso.info">Web</a>; <a href="http://twitter.com/pautasso" title="@pautasso">twitter</a></li>
				</ul>
			</slide>
			<slide>
				<title>Erik Wilde</title>
				<img src="ischool-logo.png" style="float : right ; width : 25% ; margin-top : 0.5em ; margin-right : 2em ; "/>
				<ul>
					<li>Computer Science at <a href="http://www.tu-berlin.de/eng/">Technical University of Berlin (TUB)</a> (1988-1991)</li>
					<li>Ph.D. at <a href="http://www.ethz.ch/index_EN">ETH Zürich</a> (1992-1997)</li>
					<li>Post-Doc at <a href="http://www.icsi.berkeley.edu/">ICSI, Berkeley</a> (1997/98)</li>
					<ul>
						<li>book on <q><a href="http://dret.net/netdret/publications#wil98">Technical Foundations of the World Wide Web</a></q></li>
					</ul>
					<li>Various activities back in Switzerland (1998-2006)</li>
					<ul>
						<li>teaching at <a href="http://www.ethz.ch/index_EN">ETH Zürich</a> and <a href="http://www.fhnw.ch/">FHNW</a></li>
						<li>working as independent consultant</li>
						<li>research focus on Web architecture and XML technologies</li>
					</ul>
					<li>Professor at the <a href="http://ischool.berkeley.edu/">School of Information</a> (since Fall 2006)</li>
					<ul>
						<li>technical director of the <a href="http://isd.ischool.berkeley.edu/">Information and Service Design (ISD) program</a></li>
					</ul>
					<li>Representations: <a href="http://dret.net/netdret/">Web</a>; <a href="http://dret.typepad.com/" title="dretblog">blog</a>; <a href="http://twitter.com/dret" title="@dret">twitter</a></li>
				</ul>
			</slide>
		</part>
		<part id="oa">
			<title>*OA Overload</title>
			<slide id="soa-rest">
				<title>SOA and REST</title>
				<ul>
					<li><em>Service-Oriented Architecture (SOA)</em></li>
					<ul>
						<li>Service: How to define a service</li>
						<li>Architecture: How to apply SOA in the design/implementation process</li>
					</ul>
					<li><em>Representational State Transfer (REST)</em></li>
					<ul>
						<li>Representation: Resources (not functions) are the primary abstraction</li>
						<li>State: Trying to push state to the <q>edges</q> (client or resource)</li>
						<li>Transfer: Focus on the exchange of representations (uniform interface)</li>
					</ul>
				</ul>
			</slide>
			<slide id="soa">
				<title>What is SOA?</title>
				<ul>
					<li>What is <em>Service-Oriented Architecture</em>?</li>
				</ul>
				<ol>
					<li>Alignment of <em>business objectives</em> and <em>IT</em></li>
					<ul>
						<li>can be implemented with any architecture, technology, products</li>
						<li>SOA explained like this is more for business-oriented people</li>
						<li>this definition is not within the realm of technical terms</li>
					</ul>
					<li>Technical architecture (interfaces are exposing <em>services</em>)</li>
					<ul>
						<li>focus on IT and the idea of <em>services</em> as the main abstraction</li>
						<li>still little guidance on how exactly a service is identified and exposed</li>
						<li>this definition is in the right space, but often highly underspecified</li>
					</ul>
					<li>SOA as the high-level explanation for <em href="http://en.wikipedia.org/wiki/Web_service">WS-* Web Services</em></li>
					<ul>
						<li>this is how SOA as a buzzword started (<q>SOA as architecture for Web Services</q>)</li>
						<li>most SOA products are focusing on this (overly narrow) view of <em>Web Services</em></li>
						<li>this definition has too many implicit decisions built-in</li>
					</ul>
				</ol>
			</slide>
			<slide>
				<title>From SOA to REST</title>
				<ul>
					<li>Starting from the <em>second definition of SOA</em></li>
					<ul>
						<li>a <em>technical architecture for structuring/implementing a service landscape</em></li>
						<li>many crucial aspects are undefined/underspecified and need clarification</li>
					</ul>
					<li><em>Services</em> can come in a variety of flavors</li>
					<ul>
						<li>IT services often are guided by middleware/RPC views of the world</li>
						<li>Web architecture does not expose middleware/RPC views of services</li>
						<li>Web services (<em>not</em> the WS-* kind) are exposed as resources and links</li>
						<li>aligning <em>Services</em> and <em>the Web</em> means redefining services</li>
					</ul>
					<li><em>From SOA to REST</em> is about SOA and Web architecture</li>
					<ul>
						<li>SOA with the goal of designing services for the Web</li>
						<li>the most important part is to get the <q>service</q> part right</li>
						<li>RESTful SOA means properly designing/implementing Web services</li>
					</ul>
				</ul>
			</slide>
			<slide>
				<title>What are Web Services?</title>
				<blockquote>Definition: A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.</blockquote>
				<p class="quotenote"><a href="http://www.w3.org/TR/ws-arch/#whatis"><q>Web Services Architecture</q>, W3C Working Group Note, February 11, 2004</a></p>
			</slide>
			<slide id="roa">
				<title short="ROA">Resource Oriented Architecture (ROA)</title>
				<img src="restful-web-services.jpg" style="float : right ; width : 20% ; margin : 0 1em 2em 2em ; " href="http://oreilly.com/catalog/9780596529260/" title="RESTful Web Services"/>
				<ul>
					<li>More concrete guidelines for Web-based implementations</li>
					<li>Taking <em>services</em> and turning them into <em>RESTful Web services</em></li>
					<ul>
						<li>Query string parameters are appropriate if they are inputs to a Resource which is an algorithm</li>
						<li>Prefer pragmatic uses of putting data into URI, instead of using HTTP Headers</li>
						<li>RPC-style APIs are avoided in favor of Resources and protocols</li>
						<li>A representation of a resource should have many links to the other Resources in the application, so that a client can discover state transitions</li>
						<li>URI templates provide the technology behind specifying families of URI to clients</li>
					</ul>
					<li>Not really an architecture, more a <q>set of engineering principles</q></li>
				</ul>
			</slide>
			<slide id="Woa">
				<title short="WOA">Web Oriented Architecture (WOA)</title>
				<ul>
					<li><q>WOA: Putting the Web back in Web Services</q></li>
					<li>Unclear distinction from ROA (maybe no HTTP extensions?)</li>
					<li>Questionable conceptual landscape</li>
					<ul>
						<li><q href="http://hinchcliffe.org/archive/2006/08/05/8489.aspx">REST is the protocol most preferred since it's a natural extension of HTTP for the purposes of sharing self-describing information and state.</q></li>
					</ul>
				</ul>
			</slide>
			<slide id="synoa">
				<title short="SynOA">Syndication Oriented Architecture (SynOA)</title>
				<ul>
					<li><em>Syndication</em> can be regarded as a pattern for information dissemination</li>
					<li><link href="atom"/> and <link href="atompub"/> are existing Web standards for syndication</li>
					<li>SynOA is a pattern for building a SOA architecture</li>
					<ul>
						<li>services are defined around collections</li>
						<li>interactions are centered around reading and updating feeds</li>
					</ul>
				</ul>
			</slide>
			<slide id="eoa">
				<title short="EOA">Event Oriented Architecture (EOA)</title>
				<ul>
					<li>Riding the SOA wave for event-oriented systems</li>
					<li>Now trademarked by <a href="http://www.eclient.com/">eClient</a></li>
				</ul>
			</slide>
		</part>
		<slide>
			<title>Conclusions</title>
			<ul>
				<li>*OA is hard to define and very hype-sensitive</li>
				<li>SOA lacks well-defined ways of how to define a service</li>
				<li>Business-level SOA tends to be implemented RPC-oriented/WS-*</li>
				<li>RESTful SOA is a better route for achieving <a href="http://dret.net/netdret/docs/loosely-coupled-www2009/">loose coupling</a></li>
			</ul>
		</slide>
		<slide>
			<title>Schedule</title>
			<ul>
				<li>9.00-10.30: Intro &amp; <link href="rest"/></li>
				<li>11.00-12.30: <link href="design"/></li>
				<li>14.30-16.00: <link href="rest-ws"/></li>
				<li>16.30-18.00: <link href="practice"/></li>
			</ul>
		</slide>
	</presentation>
	<presentation id="rest">
		<title short="REST">What is REST?</title>
		<author><a href="http://dret.net/netdret/">Erik Wilde</a></author>
		<affiliation short="UC Berkeley ISchool"><a href="http://www.berkeley.edu/" title="University of California, Berkeley">UC Berkeley</a> <a href="http://ischool.berkeley.edu/" title="ISchool">School of Information</a></affiliation>
		<toc class="notes">(<a href="rest.pdf" title="PDF Version">PDF</a>)</toc>
        <toc class="resources"><a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm" title="Roy Thomas Fielding, 'Architectural Styles and the Design of Network-based Software Architectures', Ph.D. Thesis, University of California, Irvine, Irvine, California, 2000">Fielding&#160;Dissertation</a>&#160;· <a href="http://portal.acm.org/citation.cfm?doid=337180.337228" title=" 	
Roy Thomas Fielding and Richard N. Taylor, 'Principled Design of the Modern Web Architecture', ACM Transactions on Internet Technology, 2(2):115-150, May 2002">ACM&#160;Transactions</a></toc>
		<toc class="abstract"><em>Representational State Transfer (REST)</em> is defined as an <em>architectural style</em>, which means that it is not a concrete systems architecture, but instead a set of constraints that are applied when designing a systems architecture. We briefly discuss these constraints, but then focus on explaining how the Web is one such systems architecture that implements REST. In particular, the mechanisms of the <em>Uniform Resource Identifiers (URIs)</em>, the <em>Hypertext Transfer Protocol (HTTP)</em>, media types, and markup languages such as the <em>Hypertext Markup Language (HTML)</em> and the <em>Extensible Markup Language (XML)</em>. We also introduce <em>Atom</em> and the <em>Atom Publishing Protocol (AtomPub)</em> as two established ways on how RESTful services are already provided and used on today's Web.</toc>
		<slide>
			<title>Abstract</title>
            <p class="abstract"><toc class="abstract"/></p>
		</slide>
		<part id="layers">
			<title>Abstraction Layers</title>
			<slide>
				<title>What is REST?</title>
				<ul>
					<li>Defining <em>Representational State Transfer</em>: 3 popular definitions</li>
				</ul>
				<ol>
					<li>An <em>architectural style</em> for building loosely coupled systems</li>
					<ul>
						<li>defined by a set of very general <em>constraints</em> (<em>principles</em>)</li>
						<li>the Web (URI/HTTP/HTML/XML) is an <em>instance</em> of this style</li>
					</ul>
					<li><em>The Web used correctly</em> (i.e., not using the Web as transport)</li>
					<ul>
						<li>HTTP is built according to RESTful principles</li>
						<li>services are built on top of Web standards without misusing them</li>
						<li>most importantly, HTTP is an <em>application protocol</em> (not a <em>transport protocol</em>)</li>
					</ul>
					<li>Anything that <em>uses HTTP and XML</em> (XML without SOAP)</li>
					<ul>
						<li>XML-RPC was the first approach for this</li>
						<li>violates REST because there is no uniform interface</li>
					</ul>
				</ol>
			</slide>
			<slide>
				<title>What is Architecture?</title>
				<ul>
					<li>What is the <q>A</q> in SOA?</li>
					<li>Architecture is <em>constraint-based design</em></li>
					<ul>
						<li><em>constraints</em> are derived from <em>requirements</em> (<q>contextualized requirements</q>)</li>
						<li>design without constraints probably is <em>art</em></li>
					</ul>
					<li>Constraints can be derived from a wide variety of sources</li>
					<ul>
						<li>technical infrastructure (current landscape and expected developments)</li>
						<li>business considerations (current landscape and expected developments)</li>
						<li>time horizon (short-term vs. long-term requirements)</li>
						<li>existing architecture</li>
						<li>scalability</li>
						<li>performance (based on performance requirements and definitions)</li>
						<li>cost (development, deployment, maintenance)</li>
					</ul>
				</ul>
			</slide>
			<slide>
				<title>Architecture Examples</title>
				<table width="95%">
					<tr>
						<td><img style="width : 90% ; margin : 2% ; " src="map-newyork.png" title="New York City" href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=new+york,+ny&amp;sll=37.875819,-122.265515&amp;sspn=0.015108,0.02341&amp;ie=UTF8&amp;ll=40.75909,-73.986912&amp;spn=0.110003,0.187283&amp;z=13&amp;iwloc=A"/></td>
						<td><img style="width : 90% ; margin : 2% ; " src="map-luebeck.png" title="Lübeck" href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=luebeck,+germanyamp;&amp;sll=40.75909,-73.986912&amp;sspn=0.110003,0.187283&amp;ie=UTF8&amp;ll=53.870091,10.687551&amp;spn=0.042814,0.093641&amp;z=14&amp;iwloc=A"/></td>
					</tr>
				</table>
			</slide>
			<slide>
				<title>Architecture vs. Design</title>
				<img style="width : 90% ; margin : 2% ; " src="rooftop-pool.jpg" title="Nice Design, Expensive Architecture" href="http://www.starwoodhotels.com/luxury/property/overview/index.html?propertyID=3321"/>
			</slide>
			<slide>
				<title>Architectural Styles</title>
				<ul>
					<li>Architectural Style vs. Architecture</li>
					<ul>
						<li>Architectural Style: General principles informing the creation of an architecture</li>
						<li>Architecture: Designing a solution to a problem according to given constraints</li>
						<li>Architectural styles <em>inform</em> and <em>guide</em> the creation of architectures</li>
					</ul>
				</ul>
				<table width="95%">
					<tr>
						<td>
							<img style="width : 90% ; margin : 2% ; " src="louvre.jpg" title="Louvre Interior"/>
							<ul>
								<li>Architecture: <a href="http://en.wikipedia.org/wiki/Louvre">Louvre</a></li>
								<li>Architectural Style: <a href="http://en.wikipedia.org/wiki/Baroque_architecture">Baroque</a></li>
							</ul>
						</td>
						<td>
							<img style="width : 90% ; margin : 2% ; " src="savoye.jpg" title="Villa Savoye Interior"/>
							<ul>
								<li>Architecture: <a href="http://en.wikipedia.org/wiki/Villa_Savoye">Villa Savoye</a></li>
								<li>Architectural Style: <a href="http://en.wikipedia.org/wiki/International_Style_(architecture)">International Style</a></li>
							</ul>
						</td>
					</tr>
				</table>
			</slide>
			<slide>
				<title>REST is not an Architecture</title>
				<ul>
					<li>REST is an architectural style</li>
					<ul>
						<li>distilled from the Web <em>a posteriori</em></li>
						<li>some of the Web's standards and practices are not perfectly RESTful</li>
					</ul>
					<li>The Web is an information system following REST</li>
					<li>It is possible to design other RESTful information systems</li>
					<ul>
						<li>different uniform interfaces (not using HTTP's methods)</li>
						<li>different representations (not using HTML or XML)</li>
						<li>different identification (not using URIs)</li>
					</ul>
				</ul>
			</slide>
			<slide>
				<title>SOA is not an Architecture</title>
				<ul>
					<li>SOA is more a style than an architecture</li>
					<li>SOA's biggest problem: What is a <em>service</em>?</li>
					<ul>
						<li>is a service something that is described by RPC-like custom functions?</li>
						<li>is a service exposed through a uniform interface?</li>
					</ul>
					<li><a href="http://www.oasis-open.org/">OASIS</a> has a <a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=soa-rm">SOA Reference Model TC</a></li>
					<ul>
						<li>the <a href="http://docs.oasis-open.org/soa-rm/v1.0/soa-rm.pdf">Reference Model</a> defines a <q>service</q> as <q>a mechanism to enable access to one or more capabilities, where the access is provided using a prescribed interface and is exercised consistent with constraints and policies as specified by the service description.</q></li>
						<li>the <a href="http://docs.oasis-open.org/soa-rm/soa-ra/v1.0/soa-ra-pr-01.pdf">Reference Architecture</a> describes a WS-* oriented world view</li>
					</ul>
					<li>SOA can be done RESTfully or not</li>
					<ul>
						<li>whether a RESTful approach makes sense depends on the constraints</li>
						<li>if the constraints allow REST, there should be a good reason for ignoring REST</li>
					</ul>
				</ul>
			</slide>
		</part>
		<part id="rest-definition">
			<title>REST: The Definition</title>
			<slide>
				<title>The REST Architectural Style</title>
				<ul>
					<li>A set of constraints that inform an architecture</li>
				</ul>
				<ol>
					<li><link href="identification-constraint"/></li>
					<li><link href="interface-constraint"/></li>
					<li><link href="self-describing-constraint"/></li>
					<li><link href="hypermedia-constraint"/></li>
					<li><link href="stateless-constraint"/></li>
				</ol>
				<ul>
					<li>Claims: scalability, mashup-ability, usability, accessibility</li>
				</ul>
			</slide>
			<slide id="identification-constraint">
				<title>Resource Identification</title>
				<ul>
					<li>Name everything that you want to talk about</li>
					<li><q>Thing</q> in this case should refer to <em>anything</em></li>
					<ul>
						<li><em>products</em> in an online shop</li>
						<li><em>categories</em> that are used for grouping products</li>
						<li><em>customers</em> that are expected to buy products</li>
						<li><em>shopping carts</em> where customers collect products</li>
					</ul>
					<li><em>Application state</em> also is represented as a resource</li>
					<ul>
						<li><em>next</em> links on multi-page submission processes</li>
						<li><em>paged results</em> with URIs identifying following pages</li>
					</ul>
				</ul>
			</slide>
			<slide id="interface-constraint">
				<title>Uniform Interface</title>
				<ul>
					<li>The same small set of operations applies to <link href="identification-constraint">everything</link></li>
					<li>A small set of <em>verbs</em> applied to a large set of <em>nouns</em></li>
						<li>verbs are universal and not invented on a per-application base</li>
						<li>if many applications need new verbs, the uniform interface can be extended</li>
						<li>natural language works in the same way (new verbs rarely enter language)</li>
					<li>Identify operations that are candidates for optimization</li>
					<ul>
						<li><http>GET</http> and <http>HEAD</http> are <em>safe operations</em></li>
						<li><http>PUT</http> and <http>DELETE</http> are <em>idempotent operations</em></li>
						<li><http>POST</http> is the catch-all and can have side-effects</li>
					</ul>
					<li>Build functionality based on useful properties of these operations</li>
				</ul>
			</slide>
			<slide id="self-describing-constraint">
				<title>Self-Describing Messages</title>
				<ul>
					<li>Resources are abstract entities (they cannot be used <em>per se</em>)</li>
					<ul>
						<li><link href="identification-constraint"/> guarantees that they are clearly identified</li>
						<li>they are accessed through a <link href="interface-constraint"/></li>
					</ul>
					<li>Resources are accessed using <em>resource representations</em></li>
					<ul>
						<li>resource representations are sufficient to represent a resource</li>
						<li>it is communicated which kind of representation is used</li>
						<li>representation formats can be negotiated between peers</li>
					</ul>
					<li>Resource representations can be based on different constraints</li>
					<ul>
						<li>XML and JSON can represent the same model for different users</li>
						<li>whatever the representation is, it must <link href="hypermedia-constraint"> support links</link></li>
					</ul>
				</ul>
			</slide>
			<slide id="hypermedia-constraint">
				<title>Hypermedia Driving Application State</title>
				<ul>
					<li><link href="self-describing-constraint">Resource representations</link> contain links to <link href="identification-constraint">identified resources</link></li>
					<li>Resources and state can be used by navigating links</li>
					<ul>
						<li>links make interconnected resources navigable</li>
						<li>without navigation, identifying new resources is service-specific</li>
					</ul>
					<li>RESTful applications <em>navigate</em> instead of <em>calling</em></li>
					<ul>
						<li><link href="self-describing-constraint">representations</link> contain information about possible traversals</li>
						<li>the application navigates to the next resource depending on link semantics</li>
						<li>navigation can be delegated since all links use <link href="identification-constraint">identifiers</link></li>
					</ul>
				</ul>
			</slide>
			<slide id="stateless-constraint">
				<title>Stateless Interactions</title>
				<ul>
					<li>This constraint does not say <q>Stateless Applications</q>!</li>
					<ul>
						<li>for many RESTful applications, state is an essential part</li>
						<li>the idea of REST is to avoid long-lasting transactions <em>in applications</em></li>
					</ul>
					<li>Statelessness means to move state to clients or resources</li>
					<ul>
						<li>the most important consequence: avoid state in server-side applications</li>
					</ul>
					<li><em>Resource state</em> is managed on the server</li>
					<ul>
						<li>it is the same for every client working with the service</li>
						<li>when a client changes resource state other clients see this change as well</li>
					</ul>
					<li><em>Client state</em> is managed on the client</li>
					<ul>
						<li>it is specific for a client and thus has to be maintained by each client</li>
						<li>it may affect <em>access</em> to server resources, but not the resources themselves</li>
					</ul>
					<li><em>Security issues</em> usually are important with client state</li>
					<ul>
						<li>clients can (try to) cheat by lying about their state</li>
						<li>keeping client state on the server is expensive (but may be worth the price)</li>
					</ul>
				</ul>
			</slide>
		</part>
		<part id="web-arch">
			<title>Web Architecture</title>
			<slide>
				<title>What is the Web?</title>
				<ul>
					<li>Web = URI + HTTP + ( HTML | XML )</li>
					<li>RESTful Web uses HTTP methods as the uniform interface</li>
					<ul>
						<li>non-RESTful Web uses <http>GET</http>/<http>POST</http> and tunneled RPC calls</li>
						<li>a <q>different RESTful Web</q> uses <em>Web Distributed Authoring and Versioning (WebDAV)</em></li>
					</ul>
					<li>Imagine your application being used in <q>10 browsers</q></li>
					<ul>
						<li>resources to interact with should be <link href="identification-constraint">identified</link> and <link href="hypermedia-constraint">linked</link></li>
						<li>a user's preferred font size could be modeled as client state</li>
						<li>what about an access count associated with an API key?</li>
					</ul>
					<li>Imagine your application being used in <q>10 browser tabs</q></li>
					<ul>
						<li>no difference as long as client state is representation-based</li>
						<li>cookies are shared across browser windows (different <q>client scope</q>)</li>
					</ul>
				</ul>
			</slide>
			<part id="uri">
				<title short="URI">Uniform Resource Identifier (URI)</title>
				<slide>
					<title>Identifying Resources on the Web</title>
					<ul>
						<li>Essential for implementing a <link href="identification-constraint"/></li>
						<li>URIs are human-readable universal identifiers for <q>stuff</q></li>
						<ul>
							<li>many identification schemes are not human-readable (binary or hex strings)</li>
							<li>many RPC-based systems do not have universally identified objects</li>
						</ul>
						<li>Making every thing a universally unique identified thing is important</li>
						<ul>
							<li>it removes the necessity to <em>scope</em> non-universal identifiers</li>
							<li>it allows to talk about all things in exactly the same way</li>
						</ul>
					</ul>
				</slide>
				<slide>
					<title>URI Schemes</title>
					<pre>URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]</pre>
					<ul>
						<li>URIs in their general case are very simple</li>
						<ul>
							<li>the scheme identifies how resources are identified</li>
							<li>the identification may be hierarchical or non-hierarchical</li>
						</ul>
						<li>Many URI schemes are hierarchical</li>
						<ul>
							<li>it is then possible to use relative URIs such as in <elem>a href="../"</elem></li>
							<li>the slash character is not just a character, in URIs it has semantics</li>
						</ul>
					</ul>
					<blockquote>[…] the URI syntax is a federated and extensible naming system wherein each scheme's specification may further restrict the syntax and semantics of identifiers using that scheme.</blockquote>
					<p class="quotenote"><a href="http://dret.net/rfc-index/reference/RFC3986"><q>Uniform Resource Identifier (URI): Generic Syntax</q>, RFC 3986, January 2005</a></p>
				</slide>
				<slide id="uri-query">
					<title>Query Information</title>
					<ul>
						<li>Query components specify additional information</li>
						<ul>
							<li>it is non-hierarchical information further identifying the resource</li>
							<li>in most cases, it can be regarded as <q>input</q> to the resource</li>
						</ul>
						<li>Query components often influence caching</li>
						<ul>
							<li>successful <http>GET</http>/<http>HEAD</http> requests may be cached</li>
							<li>only cache query string URIs when explicitly requested (<http>Expires</http>/<http>Cache-Control</http>)</li>
						</ul>
					</ul>
					<blockquote>The query component contains non-hierarchical data that, along with data in the path component […], serves to identify a resource within the scope of the URI's scheme and naming authority […].</blockquote>
					<p class="quotenote"><a href="http://dret.net/rfc-index/reference/RFC3986"><q>Uniform Resource Identifier (URI): Generic Syntax</q>, RFC 3986, January 2005</a></p>
				</slide>
				<slide>
					<title>Processing URIs</title>
					<ul>
						<li>Processing URIs is not as trivial as it may seem</li>
						<ul>
							<li>escaping and normalization rules are non-trivial</li>
							<li>many implementations are broken</li>
							<li>complain about broken implementations</li>
							<li>even more complicated when processing an <em>Internationalized Resource Identifier (IRI)</em></li>
						</ul>
						<li>URIs are not just strings</li>
						<ul>
							<li>URIs are strings with a considerable set of rules attached to them</li>
							<li>implementing all these rules is non-trivial</li>
							<li>implementing all these rules is crucial</li>
							<li>application development environments provide functions for URI handling</li>
						</ul>
					</ul>
				</slide>
			</part>
			<part id="http">
				<title short="http">Hypertext Transfer Protocol (HTTP)</title>
				<slide>
					<title>How RESTful Applications Talk</title>
					<ul>
						<li>Essential for implementing a <link href="interface-constraint"/></li>
						<ul>
							<li>HTTP defines a small set of methods for acting on URI-identified resources</li>
						</ul>
						<li>Misusing HTTP turns application into non-RESTful applications</li>
						<ul>
							<li>they lose the capability to be used just by adhering to REST principles</li>
							<li>it's a bad sign when you think you need an interface description language</li>
						</ul>
						<li>Extending HTTP turns applications into more specialized RESTful applications</li>
						<ul>
							<li>may be appropriate when more operations are required</li>
							<li>seriously reduces the number of potential clients</li>
						</ul>
					</ul>
				</slide>
				<slide id="http-methods">
					<title>HTTP Methods</title>
					<ul>
						<li><em>Safe methods</em> can be ignored or repeated without side-effects</li>
						<ul>
							<li>arithmetically safe: <code>41 × 1 × 1 × 1 × 1 …</code></li>
							<li>in practice, <q>without side-effects</q> means <q>without relevant side-effects</q></li>
						</ul>
						<li><em>Idempotent methods</em> can be repeated without side-effects</li>
						<ul>
							<li>arithmetically idempotent: <code>41 × 0 × 0 × 0 × 0 …</code></li>
							<li>in practice, <q>without side-effects</q> means <q>without relevant side-effects</q></li>
						</ul>
						<li>Unsafe and non-idempotent methods should be treated with care</li>
						<li>HTTP has two main <em>safe methods</em>: <http>GET HEAD</http></li>
						<li>HTTP has two main <em>idempotent methods</em>: <http>PUT DELETE</http></li>
						<li>HTTP has one main <em>overload method</em>: <http>POST</http></li>
					</ul>
				</slide>
				<slide id="cookies">
					<title>Cookies</title>
					<ul>
						<li>Cookies are <em>client site state bound to a domain</em></li>
						<ul>
							<li>they are convenient because they work <em>without having to use a representation</em></li>
							<li>they are inconvenient because they are <em>not embedded in representations</em></li>
						</ul>
						<li>Cookies are managed by the client</li>
						<ul>
							<li>they are shared across browser tabs</li>
							<li>they are not shared across browsers used by the same user</li>
							<li>essentially, the <em>client</em> model of cookies is a bit outdated</li>
						</ul>
						<li>Two major things to look out for when using cookies:</li>
						<ol>
							<li><em>session IDs</em> are <em>application state</em> (i.e., non-resource state)</li>
							<li>cookies break the back button (requests contain a <q>URI/cookie</q> combo)</li>
						</ol>
						<li>The ideal RESTful cookie is never sent to the server</li>
						<ul>
							<li>cookies as <em>persistent data storage on the client</em></li>
							<li>interactions with the server are only using URIs and representations</li>
						</ul>
					</ul>
				</slide>
			</part>
		</part>
		<part id="representations">
			<title>Representations</title>
			<part id="documents">
				<title>Structured Documents</title>
				<slide>
					<title>What is identified by a URI?</title>
					<ul>
						<li>Essential for implementing <link href="self-describing-constraint"/></li>
						<ul>
							<li>also should provide support for <link href="hypermedia-constraint"/></li>
						</ul>
						<li><link href="identification-constraint"/> only talks about an <em>abstract resource</em></li>
						<ul>
							<li>resources are never exchanged or otherwise processed directly</li>
							<li>all interactions use <em>resource representations</em></li>
						</ul>
						<li>Representations depend on various factors</li>
						<ul>
							<li>the nature of the resource</li>
							<li>the capabilities of the server</li>
							<li>the capabilities or the communications medium</li>
							<li>the capabilities of the client</li>
							<li>requirements and constraints from the application scenario</li>
							<li>negotiations to figure out the <q>best</q> representation</li>
						</ul>
						<li>Representations are identified by <a href="http://dret.net/lectures/web-fall08/mediatypes"><em>media type</em> (sometimes called <em>MIME type</em>)</a></li>
					</ul>
				</slide>
				<slide id="xml">
					<title short="XML">Extensible Markup Language (XML)</title>
					<ul>
						<li>The language that started it all</li>
						<ul>
							<li>created as a streamlined version of SGML</li>
							<li>took over as the first universal language for structured data</li>
						</ul>
						<li>XML is a metalanguage (a language for representing languages)</li>
						<ul>
							<li>many domain-specific languages are defined as XML vocabularies</li>
							<li>some metalanguages use XML syntax (<link href="rdf">RDF</link> is a popular example)</li>
						</ul>
						<li>XML is only syntax and has almost zero semantics</li>
						<ul>
							<li>very minimal built-in semantics (language identification, IDs, relative URIs)</li>
							<li>semantics are entirely left to the XML vocabularies</li>
						</ul>
						<li>XML is built around a tree model</li>
						<ul>
							<li>each XML document is a tree and thus limited in structure</li>
							<li>RESTful XML introduces hypermedia to turn XML data into a graph</li>
						</ul>
					</ul>
				</slide>
				<slide id="json">
					<title short="JSON">JavaScript Object Notation (JSON)</title>
					<ul>
						<li>The <code>XMLHttpRequest</code> API has been built for requesting XML via HTTP</li>
						<ul>
							<li>this is useful because XML is the most popular data format</li>
							<li>all requested data has to be processed by using XML access methods in JavaScript</li>
						</ul>
						<li>JavaScript does not have XML as its internal data model</li>
						<ul>
							<li>the XML received via <code>XMLHttpRequest</code> has to be parsed into a DOM tree</li>
							<li>DOM access in JavaScript is inconvenient for complex operations</li>
							<li>alternatively, the XML can be mapped to JavaScript objects (also requires parsing)</li>
						</ul>
						<li><em>JavaScript Object Notation (JSON)</em> encodes data as JavaScript objects</li>
						<ul>
							<li>more efficient for the consumer if the consumer is written in JavaScript</li>
							<li>this turns the generally usable XML service into a JavaScript-oriented service</li>
							<li>for large-scale applications, it might make sense to provide XML and JSON</li>
							<li>this can be negotiated with <em>HTTP content negotiation</em></li>
						</ul>
					</ul>
				</slide>
				<slide>
					<title>JSON Example</title>
					<listing src="menu.xml"/>
					<listing src="menu.json"/>
				</slide>
				<slide id="rdf">
					<title short="RDF">Resource Description Framework (RDF)</title>
					<ul>
						<li>Developed around the same time as XML was developed</li>
						<ul>
							<li>based on the idea of machine-readable/understandable semantics</li>
							<li>builds the <em>Semantic Web</em> as a parallel universe on top of the Web</li>
						</ul>
						<li>RDF uses URIs for <em>naming things</em></li>
						<ul>
							<li>RDF's data model is based on (URI, property, value) triples</li>
							<li>triples are combined and inference is used to produce a graph</li>
						</ul>
						<li>RDF is a metalanguage built on the triple-based data model</li>
						<ul>
							<li>RDF has a number of syntaxes (one of them is <link href="xml">XML</link>-based)</li>
							<li>RDF introduces a number of schema languages (often referred to as <em>ontology languages</em>)</li>
						</ul>
					</ul>
				</slide>
				<slide>
					<title>Atom</title>
					<ul>
						<li>A language for representing <em>syndication feeds</em></li>
						<li>Much more modest in its goal than <link href="xml">XML</link> or <link href="rdf">RDF</link></li>
						<ul>
							<li>models feeds as a sets of entries with associated metadata</li>
							<li>uses an XML vocabulary for representing the data model</li>
							<li>uses <em>links</em> for expressing relationships in the data model</li>
						</ul>
						<li>Will be discussed in detail as <link href="practice">a good foundation for REST</link></li>
					</ul>
				</slide>
			</part>
			<part id="links">
				<title>Linked Documents</title>
				<slide>
					<title>Making Resources Navigable</title>
					<ul>
						<li>Essential for using <link href="hypermedia-constraint"/></li>
						<li>RPC-oriented systems need to expose the available functions</li>
						<ul>
							<li>functions are essential for interacting with a service</li>
							<li>introspection or interface descriptions make functions discoverable</li>
						</ul>
						<li>RESTful systems use a <link href="interface-constraint"/></li>
						<ul>
							<li>no need to learn about functions</li>
							<li>but how to find resources?</li>
						</ul>
						<ol>
							<li>find them by following links from other resources</li>
							<li>learn about them by using <link href="uri-templates"/></li>
							<li>understand them by recognizing representations</li>
						</ol>
					</ul>
				</slide>
				<slide id="uri-templates">
					<title>URI Templates</title>
					<ul>
						<li>REST does not care about URI details</li>
						<li>Apart from the <uri>scheme</uri>, URIs should be semantically opaque</li>
						<ul>
							<li>media types should not guessed by URI (breaks content negotiation)</li>
							<li>semantics should not be inferred from inspecting URIs</li>
							<li>URIs should not be guessed based on previously encountered URIs</li>
						</ul>
						<li><q>URI hacking</q> on the Web works and can be useful</li>
						<ul>
							<li>Firefox <a href="http://dret.typepad.com/dretblog/2008/07/go-up.html">Go Up</a> allows easy navigation up one level</li>
							<li>good URIs and bad UIs sometimes turn the address bar into a useful UI</li>
						</ul>
						<li>Technically speaking, URI templates are not required by REST</li>
						<ul>
							<li>practically speaking, URI templates are a useful best practice</li>
							<li>all URI navigable resources should also be navigable using representations</li>
						</ul>
					</ul>
				</slide>
			</part>
		</part>
		<part id="state">
			<title>State</title>
			<slide>
				<title>State Management on the Web</title>
				<ul>
					<li>Essential for supporting <link href="stateless-constraint"/></li>
					<li><link href="cookies"/> are a frequently used mechanism for managing state</li>
					<ul>
						<li>in many cases used for maintaining session state (login/logout)</li>
						<li>more convenient than having to embed the state in every representation</li>
						<li>some Web frameworks switch automatically between cookies and URI rewriting</li>
					</ul>
					<li>Cookies have two interesting client-side side-effects</li>
					<ul>
						<li>they are stored persistently independent from any representation</li>
						<li>they are <q>shared state</q> within the context of one browser</li>
					</ul>
					<li>Session ID cookies require expensive server-side tracking</li>
					<ul>
						<li>not associated with any resource and thus potentially global</li>
						<li>load-balancing must be cookie-sensitive or cookies must be global</li>
					</ul>
					<li><em>Resource-based state</em> allows RESTful service extensions</li>
				</ul>
			</slide>
			<slide>
				<title>State in HTML or HTTP</title>
				<img style="width : 90% ; margin : 2% ; " src="web-app-client-state.png" title="State in HTML or HTTP"/>
			</slide>
			<slide>
				<title>State in the Server Application</title>
				<img style="width : 90% ; margin : 2% ; " src="web-app-server-state.png" title="State in the Server Application"/>
			</slide>
			<slide>
				<title>State as a Resource</title>
				<img style="width : 90% ; margin : 2% ; " src="web-app-resource-state.png" title="State as a Resource"/>
			</slide>
			<slide>
				<title>Stateless Shopping</title>
				<ul>
					<li>Typical <q>session scenarios</q> can be <a href="http://www.peej.co.uk/articles/no-sessions.html">mapped to resources</a></li>
					<ul>
						<li>Client: Show me your products</li>
						<li>Server: Here's a list of all the products</li>
						<li>Client: I'd like to buy 1 of http://ex.org/product/X, I am "John"/"Password"</li>
						<li>Server: I've added 1 of http://ex.org/product/X to http://ex.org/users/john/basket</li>
						<li>Client: I'd like to buy 1 of http://ex.org/product/Y, I am "John"/"Password"</li>
						<li>Server: I've added 1 of http://ex.org/product/Y to http://ex.org/users/john/basket</li>
						<li>Client: I don't want http://ex.org/product/X, remove it, I am "John"/"Password"</li>
						<li>Server: I've removed http://ex.org/product/X to http://ex.org/users/john/basket</li>
						<li>Client: Okay I'm done, username/password is "John"/"Password"</li>
						<li>Server: Here is the total cost of the items in http://ex.org/users/john/basket</li>
					</ul>
					<li>This is more than just renaming <q>session</q> to <q>resource</q></li>
					<ul>
						<li>all relevant data is stored persistently on the server</li>
						<li>the shopping cart's URI can be used by other services for working with its contents</li>
						<li>instead of <em>hiding the cart in the session</em>, it is <em>exposed as a resource</em></li>
					</ul>
				</ul>
			</slide>
			<slide>
				<title>Reusing Resources</title>
				<img style="width : 90% ; margin : 2% ; " src="web-app-reusing-resource.png" title="Reusing Resources"/>
			</slide>
		</part>
		<slide>
			<title>Conclusions</title>
			<ul>
				<li>REST is simple to learn and use</li>
				<li>Unlearning RPC in most cases is the hardest part</li>
				<ul>
					<li>OO is all about identifying classes and methods</li>
					<li>distributed systems very often are built around RPC models</li>
					<li>many classical IT architectures are RPC-centric by design</li>
				</ul>
				<li>REST and RPC do not mix</li>
				<ul>
					<li>resource orientation ↔ function orientation</li>
					<li>cooperation ↔ integration</li>
					<li>openly distributed ↔ hiding distribution</li>
					<li>coarse-grained ↔ fine-grained</li>
					<li>complexity in resources formats ↔ complexity in function set</li>
				</ul>
			</ul>
		</slide>
	</presentation>
	<presentation id="design" external="design.pdf">
		<title short="Service Design">RESTful Service Design</title>
		<author><a href="http://www.pautasso.info/">Cesare Pautasso</a></author>
		<affiliation>Faculty of Informatics, University of Lugano</affiliation>
        <toc class="resources"><a href="http://oreilly.com/catalog/9780596529260/" title="Leonard Richardson and Sam Ruby, 'RESTful Web Services', O'Reilly &amp; Associates, Sebastopol, California, May 2007">RESTful Web Services</a></toc>
		<toc class="abstract">REST is simple to define, but understanding how to apply it to design RESTful services is more difficult. The goal of this part of the tutorial is to present the main design elements of a RESTful architecture and introduce a design methodology for RESTful services. A selection of useful patterns and anti-patterns will be discussed with some examples that will be further developed in the practical part.</toc>
	</presentation>
	<presentation id="rest-ws" external="rest-ws.pdf">
		<title short="REST vs. WS-*">REST vs. WS-* Comparison</title>
		<author><a href="http://www.pautasso.info/">Cesare Pautasso</a></author>
		<affiliation>Faculty of Informatics, University of Lugano</affiliation>
        <toc class="resources"><a href="http://www.jopera.org/docs/publications/2008/restws" title="Cesare Pautasso, Olaf Zimmermann, and Frank Leymann, 'RESTful Web Services vs. Big Web Services: Making the Right Architectural Decision', pp. 805-814, Proceedings of the 17th International World Wide Web Conference, ACM Press, Beijing, China, April 2008">WWW2008&#160;REST&#160;vs.&#160;WS-*</a></toc>
		<toc class="abstract">In this part we summarize the WS-* vs. REST debate by giving a quantitative technical comparison based on architectural principles and decisions. We show that the two approaches differ in the number of architectural decisions that must be made and in the number of available alternatives. This discrepancy between freedom-from-choice and freedom-of-choice explains the complexity difference perceived. However, we also show that there are significant differences in the consequences of certain decisions in terms of resulting development and maintenance costs. The comparison helps technical decision makers to assess the two technologies more objectively and select the one that best fits their needs: REST is well suited for basic, ad hoc integration scenarios, WS-* is more flexible and addresses advanced quality of service requirements commonly occurring in enterprise computing.</toc>
	</presentation>
	<presentation id="practice">
		<title short="Practice">REST in Practice</title>
		<author><a href="http://dret.net/netdret/">Erik Wilde</a></author>
		<affiliation short="UC Berkeley ISchool"><a href="http://www.berkeley.edu/" title="University of California, Berkeley">UC Berkeley</a> <a href="http://ischool.berkeley.edu/" title="ISchool">School of Information</a></affiliation>
		<toc class="notes">(<a href="practice.pdf" title="PDF Version">PDF</a>)</toc>
        <toc class="resources"><a href="http://atompub.org/rfc4287.html" title="Atom RFC">Atom</a>&#160;· <a href="http://atompub.org/rfc5032.html" title="Atom Publishing Protocol (AtomPub) RFC">AtomPub</a>&#160;· <a href="http://validator.w3.org/feed/" title="W3C RSS/Atom Feed Validator">Feed&#160;Validator</a></toc>
		<toc class="abstract">REST's level of abstraction and its simplicity as a small set of constraints can make it hard to get a grasp on how it can be applied for real-world projects. This presentations introduces <em>real-world REST</em> by looking at how REST can be used by reusing existing RESTful designs in terms of representations and interaction protocols; <em>Atom</em> and the <em>Atom Publishing Protocol (AtomPub)</em> are used as examples for existing RESTful designs. In addition, we take a brief look at how to go beyond using these <q>canned REST</q> approaches, and how existing programming framework provide support for designing and implementing RESTful services.</toc>
		<slide>
			<title>Abstract</title>
            <p class="abstract"><toc class="abstract"/></p>
		</slide>
		<slide id="snowflake">
			<title>Precious Snowflakes</title>
			<img src="snowflakes.jpg" href="http://atompub.org/" style="float : right ; width : 25% ; margin : 0.5em 1em 1em 1em ; "/>
			<ul>
				<li>Many applications are not as unique as you might think</li>
				<ul>
					<li>reusing design patterns and even technologies is a good idea</li>
					<li>avoiding reuse usually should be justified by good reasons</li>
				</ul>
				<li>Take the Web's HTML as an inspiring example</li>
				<ul>
					<li>HTML is not all that great as a document format</li>
					<li>it was good enough as a container for a lot of useful content</li>
					<li>the <em>network effect</em> far outweighs its <em>functional shortcomings</em></li>
					<li>could you imagine a Web based on PDF or Word?</li>
				</ul>
				<li>Simplicity and wide applicability are valuable</li>
				<ul>
					<li><em>simplicity</em> means a lower barrier to entry</li>
					<li><em>wide applicability</em> means higher chances to create network effects</li>
				</ul>
			</ul>
		</slide>
		<slide>
			<title>RESTful <q>Hello World</q></title>
			<ul>
				<li>Internet connectivity establishes HTTP URI addressibility</li>
				<ul>
					<li>host must be reachable and identifyable (DNS name or at least IP address)</li>
				</ul>
				<li>HTTP server provides the uniform interface (<http>GET</http> only)</li>
				<ul>
					<li>by default listens to incoming HTTP requests on port 80</li>
					<li>in simple scenarios often is configured to (also) serve static files</li>
				</ul>
				<li>XML and <code>application/xml</code> provide a machine-readable representation</li>
				<listing src="hello-world.xml"/>
				<li>Dropping the XML into the file system creates a RESTful <q>Hello World</q> service</li>
				<ul>
					<li><code href="./src/hello-world.xml">hello-world.xml</code></li>
				</ul>
				<li>Accessible via any HTTP- and XML-capable client</li>
			</ul>
		</slide>
		<slide>
			<title>Feeds!</title>
			<img src="feedbot.jpg" style="float : right ; width : 25% ; margin : 0.5em 1em 1em 1em ; " href="http://www.flickr.com/photos/comingupforair/432964499/"/>
			<ul>
				<li>Information dissemination is a complex and varied problem</li>
				<li>Feeds look at all these problems with a simple approach</li>
				<ul>
					<li>the simple approach lacks some sophistication/specialization</li>
					<li>less specialization means wider applicability</li>
					<li>wider applicability means bigger network effects</li>
					<li>pull-based syndication is loosely coupled and scalable</li>
				</ul>
				<li>Some claim that pull publishing is bad and <em>Publish/Subscribe (PubSub)</em> is good</li>
				<ul>
					<li>there is little proof that this is more than just a claim</li>
					<li>scalable PubSub is expensive to implement (but still may make sense)</li>
					<li>PubSub may be a good idea if the requirements rule our REST</li>
				</ul>
			</ul>
		</slide>
		<slide>
			<title>Syndication</title>
			<ul>
				<li>Atom is a format and also <a href="http://dret.typepad.com/dretblog/atom-landscape.html">an evolving landscape</a></li>
				<ul>
					<li><link href="atom"/>, the feed format</li>
					<li><link href="atompub"/>, write access to Atom-oriented collections</li>
					<li>support for threaded discussions in feeds</li>
					<li>feed licensing</li>
					<li>feed paging and archiving</li>
					<li><a href="http://dret.typepad.com/dretblog/atom-landscape.html">many other ongoing developments</a></li>
				</ul>
				<li>A landscape of RESTful interactions with <q>collections of things</q></li>
			</ul>
		</slide>
		<part id="syndication-formats">
			<title>Syndication Formats</title>
			<part id="rss">
				<title>RSS</title>
				<slide id="rss-versions">
					<title>RSS History</title>
					<ul>
						<li><q><a href="http://diveintomark.org/archives/2004/02/04/incompatible-rss">The Myth of RSS Compatibility</a></q> provides a good overview</li>
						<li>RSS is a schoolbook example for <q>why standards are a good thing</q></li>
						<ul>
							<li><link href="rss09"/> was created for the <em>My Netscape</em> portal in March 1999</li>
							<li>RSS 0.91 (a simplification) was introduced in July 1999 (as an interim solution)</li>
							<li>the AOL/Netscape merger removed the format from the company's portal</li>
							<li>RSS was without an owner, and different parties claimed/denied ownership</li>
							<li><link href="rss10"/> was created by an informal developer group</li>
							<li>RSS 0.92 (and 0.93 and 0.94) were published without acknowledging RSS 1.0</li>
							<li>finally, <link href="rss20"/> was released as a follow-up to the RSS 0.9x versions</li>
						</ul>
						<li>Using RSS has become an exercise in managing a menagerie of versions</li>
					</ul>
				</slide>
				<slide id="rss20">
					<title>RSS 2.0</title>
					<ul>
						<li>RSS now means <em>Really Simple Syndication</em></li>
						<ul>
							<li>RSS 2.0 is the continuation of the 0.91 branch (which dropped RDF)</li>
							<li>together with <link href="rss10"/> it is the most popular version of RSS</li>
							<li>migration from 0.91 to 2.0 is easily possible</li>
						</ul>
						<li>RSS 2.0 tries to avoid the use of XML Namespaces</li>
						<li>RSS 2.0 is <a href="http://rss-extensions.org/wiki/Main_Page">increasingly used with extensions</a> for vendor-specific information</li>
						<ul>
							<li>the RSS core is minimal, so many applications need extensions</li>
							<li>many extensions have overlapping functionality</li>
							<li>most extensions have unclear semantics and unclear versioning policies</li>
						</ul>
					</ul>
				</slide>
				<slide>
					<title>RSS 2.0 Example</title>
					<listing src="rss20.xml" line="2-14" href="http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html"/>
				</slide>
				<slide>
					<title>Consuming RSS</title>
					<ul>
						<li>RSS feeds often have quality problems</li>
						<ul>
							<li>surprisingly often feeds do not even deliver well-formed XML</li>
							<li>the use of embedded markup in RSS is not well-defined (<q>parse and pray</q>)</li>
						</ul>
						<li>Writing an RSS reader from scratch is not a good idea</li>
						<li>There are three major tasks which RSS readers must do</li>
						<ol>
							<li>accept non-XML RSS feeds and fix them to be XML</li>
							<li>look at the feed contents and bring them into a unified form</li>
							<li>produce a unified view of feeds regardless of the RSS version</li>
						</ol>
					</ul>
				</slide>
				<slide>
					<title>RSS Political Problems</title>
					<ul>
						<li>Multiple and incompatible <link href="rss-versions"/> are still in widespread use</li>
						<ul>
							<li><link href="rss10"/> and <link href="rss20"/> are <q>incompatible by design</q> (RDF vs. non-RDF)</li>
							<li>none of the RSS versions is maintained by a universally accepted standards body</li>
						</ul>
						<li>None of the specifications is being updated or fixed</li>
						<ul>
							<li>some of the lessons learned by RSS deployment are not used in a new version</li>
							<li>it is unlikely that a new version will be produced which merges the RSS landscape</li>
						</ul>
						<li>Invent something new instead of trying to fix RSS</li>
						<ul>
							<li><link href="atom"/> started in 2003 (called <em>Echo</em> at first)</li>
							<li>W3C or IETF would have been promising candidates for a <q>new RSS</q></li>
							<li>W3C is more formal, IETF is more developer-centered</li>
							<li><a href="http://www.bestkungfu.com/?p=492">IETF was chosen over W3C</a> because the of Atom community's preferences</li>
						</ul>
					</ul>
				</slide>
			</part>
			<part id="atom">
				<title>Atom</title>
				<slide>
					<title>Atom History</title>
					<img src="atom-logo.png" href="http://atompub.org/" style="float : right ; width : 20% ; margin-top : 0.5em ; margin-right : 2em ; "/>
					<ul>
						<li>RSS's shortcomings were very apparent and could not be fixed</li>
						<li>In mid-2003, discussions started about an improved format</li>
						<li>It also became apparent that the format should have a protocol</li>
						<li>Atom 0.3 was released in December 2003 but had no formal home</li>
						<li>IETF was chosen as the new home with a working group in June 2004</li>
						<li><a href="http://dret.net/rfc-index/reference/RFC4287">RFC 4287</a> was published in December 2005</li>
						<li><link href="atompub">AtomPub</link> has been published as <a href="http://dret.net/rfc-index/reference/RFC5032">RFC 5032</a> in October 2007</li>
					</ul>
				</slide>
				<slide>
					<title>Atom vs. RSS</title>
					<ul>
						<li>Standardized by the IETF (well-defined process)</li>
						<li>Classification of entries (user-defined categories)</li>
						<li>More XML-like markup design (more nesting)</li>
						<li>Namespaces are used and supported as standard mechanism</li>
						<li>Atom feeds <em>must</em> be well-formed XML (there even <a href="http://atompub.org/2005/08/17/atom.rnc" title="Atom RELAX NG Schema">is a schema</a>)</li>
						<li>Interpretation of content is well-defined (various content types)</li>
						<li>Support for <xml>xml:lang</xml> and <xml>xml:base</xml></li>
					</ul>
				</slide>
				<slide>
					<title>Atom Example</title>
					<listing src="atom.xml"/>
				</slide>
				<slide>
					<title>Atom Content</title>
					<ul>
						<li>RSS had no safe way of finding out what an entry's content is</li>
						<ul>
							<li>this led to different implementations being <q>smart</q> about what the RSS author really wanted</li>
							<li>one of Atom's main goals was to improve this in a well-defined way</li>
							<li>Atom allows escaped markup (the only way to include non-XML HTML in an XML format)</li>
						</ul>
						<li>Each <elem>content</elem> element should have a <atom>type</atom> (the default is <atom>text</atom>)</li>
						<li>Atom's content interpretation algorithm (use first applicable rule):</li>
						<ol>
							<li>if <atom>type</atom> is <atom>text</atom>, no child elements are allowed (plain text content)</li>
							<li>if <atom>type</atom> is <atom>html</atom> then RSS's method of escaped markup is used</li>
							<li>if <atom>type</atom> is <atom>xhtml</atom> then there must be an <elem>div</elem> containing XHTML markup</li>
							<li>if <atom>type</atom> is an XML media type then the content should be treated as this type</li>
							<li>if <atom>type</atom> starts with <atom>text/</atom> then no child elements are allowed</li>
							<li>for all other values, the content must be an base64-encoded entity of the specified MIME type</li>
						</ol>
					</ul>
				</slide>
				<slide>
					<title>Atom Content Examples</title>
					<pre href="http://www.xml.com/lpt/a/1633"><![CDATA[<content type="xhtml">
  <div xmlns="http://www.w3.org/1999/xhtml">
    One <strong>bold</strong> foot forward
  </div>
</content>]]></pre>
					<pre href="http://www.xml.com/lpt/a/1633"><![CDATA[<content>The "atom:content" element either contains or links to the content of the entry. The content of atom:content is Language-Sensitive.</content>]]></pre>
					<pre href="http://www.xml.com/lpt/a/1633"><![CDATA[<content type="html">The &lt;code>atom:content&lt;/code> element either contains or links to the content of the entry. The content of &lt;code>atom:content&lt;/code> is &lt;a href="http://www.ietf.org/rfc/rfc3066.txt">Language-Sensitive&lt;/a>.</content>]]></pre>
					<pre href="http://www.xml.com/lpt/a/1633"><![CDATA[<content type="image/png">
iVBORw0KGgoA … TAAAAAElFTkSuQmCC
</content>]]></pre>
					<pre href="http://www.xml.com/lpt/a/1633"><![CDATA[<content src="image.png" type="image/png"/>]]></pre>
				</slide>
				<slide>
					<title>Atom Categories</title>
					<ul>
						<li>Atom allows to assign categories to entries</li>
						<ul>
							<li>each <elem>category</elem> element must have a <atom>term</atom> attribute for the category</li>
							<li>an optional <atom>scheme</atom> identifies the categorization scheme (ontology, taxonomy, …)</li>
							<li>an optional <atom>label</atom> attribute provides a human-readable label for the category</li>
						</ul>
						<li><link href="atompub">AtomPub</link> defines a document format for <link href="atom-category-documents"/></li>
						<li>Three different cases of categorization can be distinguished</li>
						<ol>
							<li>use a well-known scheme (such as <em>Dublin Core</em>)</li>
							<li>use a private but well-designed scheme (which has a URI and can be reused reliably)</li>
							<li>use tags without schemes, which then are little more than content labels</li>
						</ol>
					</ul>
				</slide>
				<slide>
					<title>Switching from RSS to Atom</title>
					<ul>
						<li>Generate both feeds but serve RSS with an HTTP redirect (301)</li>
						<ul>
							<li>old subscribers with broken clients can still use the RSS feed</li>
							<li>old subscribers with correct clients will use the Atom feed</li>
						</ul>
						<li>Atom exposes more information than RSS (<elem>category</elem> for tags)</li>
						<ul>
							<li>the mapping of publishing info to the feed has to be changed/extended</li>
							<li>for standard metadata use Atom's built-in metadata elements</li>
							<li>for application-specific metadata consider reusing an existing metadata schema</li>
						</ul>
						<li>Atom can be used to publish snippets as well as full content</li>
						<ul>
							<li><elem>content</elem> allows any type of content to be used and may contain a complete entry</li>
							<li><elem>summary</elem> allows only text and should provide a condensed version of an entry</li>
							<li>some Atom sources publish two feeds for summaries and content</li>
						</ul>
						<li>Generate good Atom and downgrade it to RSS 1.0 &amp; 2.0</li>
					</ul>
				</slide>
			</part>
		</part>
		<part>
			<title>Syndication Aggregation</title>
			<slide>
				<title>End-User Aggregation</title>
				<img src="feed-icon.png" style="float : right ; margin-top : 0.5em ; margin-right : 2em ; "/>
				<ul>
					<li>Users often have a small number of preferred Web sites</li>
					<ul>
						<li>news can be tracked by subscribing to their feeds</li>
						<li>this requires an RSS-aware client (Firefox is not a good RSS reader)</li>
					</ul>
					<li>How can users find a feed?</li>
					<ul>
						<li>feeds have URIs (they are Web resources) and can be referenced from within HTML</li>
					</ul>
				</ul>
				<pre title="Feed Autodiscovery for RSS">&lt;link rel="alternate" type="application/rdf+xml" title="…" href="…" />
&lt;link rel="alternate" type="application/rss+xml" title="…" href="…" /></pre>
				<pre title="Feed Autodiscovery for Atom">&lt;link rel="alternate" type="application/atom+xml" title="…" href="…" /></pre>
			</slide>
			<slide>
				<title>Aggregation Intermediaries</title>
				<div style="float : right ; width : 20% ; margin-right : 1.5em">
					<script type="text/javascript" src="http://www.google.com/reader/ui/publisher.js"></script>
					<script type="text/javascript" src="http://www.google.com/reader/public/javascript/user/16601496766743088901/state/com.google/broadcast?n=5&amp;callback=GRC_p(%7Bc%3A'gray'%2Ct%3A'Shared%20items'%2Cs%3A'true'%7D)%3Bnew%20GRC"></script>
				</div>
				<ul>
					<li>RSS is a frequently used format between content providers</li>
					<ul>
						<li>news agencies want to distribute news items as easy as possible</li>
						<li>by using a single format, producers and consumers can more easily interoperate</li>
					</ul>
					<li>The <link href="rss-versions"/> caused publishers to look for something better</li>
					<ul>
						<li><link href="rss"/> had a head start and still is widely used</li>
						<li><link href="atom"/> is a much better format and will eventually replace RSS</li>
					</ul>
					<li>User-configured portals are the merger between both scenarios</li>
					<ol>
						<li>users select a number of feeds as their preferred information sources</li>
						<li>the feeds are presented on a <a href="http://www.google.com/reader/view/" title="Google Reader">single personalized Web page</a></li>
						<li>by <a href="http://www.google.com/reader/shared/16601496766743088901" title="dret's Google Reader Shared Items">sharing</a> and <a href="http://www.google.com/reader/public/atom/user/16601496766743088901/state/com.google/broadcast" title="dret's Google Reader Atom Feed">re-publishing</a> items, users are becoming aggregation intermediaries</li>
					</ol>
				</ul>
			</slide>
			<part>
				<title>FeedBurner</title>
				<slide>
					<title>Fixing Feeds</title>
					<img style="width : 90% ; margin : 2% ; " src="feedburner-cleanup.png" title="Cleaning Up Feeds"/>
				</slide>
				<slide>
					<title>Load Balancing</title>
					<img style="width : 90% ; margin : 2% ; " src="feedburner-load-balancing.png" title="Providing Feed Load Balancing"/>
				</slide>
				<slide>
					<title>Statistics/Analytics</title>
					<img style="width : 90% ; margin : 2% ; " src="feedburner-statistics.png" title="Providing Feed Statistics"/>
				</slide>
				<slide>
					<title>Query Capabilities</title>
					<ul>
						<li>Feed technology is still evolving</li>
						<li>Feeds are mostly viewed as ordered by time</li>
						<ul>
							<li>allows optimization for accesses and caching</li>
							<li>makes it hard to use feeds for non-timed information</li>
						</ul>
						<li>Feeds could be ordered by any sort key</li>
						<ul>
							<li>makes server-side feed processing much more expensive</li>
							<li>enables customized feeds that are processed on the server-side</li>
						</ul>
					</ul>
				</slide>
				<slide>
					<title>Supporting Queryable Feeds</title>
					<img style="width : 90% ; margin : 2% ; " src="feedfilter.png" title="Supporting Queryable Feeds"/>
				</slide>
			</part>
		</part>
		<part id="atompub">
			<title short="AtomPub">Atom Publishing Protocol (AtomPub)</title>
			<slide>
				<title>RESTful Syndication</title>
				<ul>
					<li>Atom is a format for retrieving a set of entries as a feed document</li>
					<ul>
						<li>feeds often are time-based and are refreshed periodically or whenever needed</li>
						<li>feeds can use any other strategy for deciding what to publish</li>
					</ul>
					<li>Read-only access to feeds should be complemented by full access</li>
					<ul>
						<li>full access needs the <q>CUD</q> out of the <q>CRUD</q> set of operations</li>
						<li>many Web-centric technologies try to build on the Web's REST model of interaction</li>
					</ul>
					<li>AtomPub builds on Atom and adds a RESTful protocol on top of it</li>
					<ul>
						<li><http>POST</http> for creating new entries (sending the request to the collection)</li>
						<li><http>PUT</http> for updating existing entries (overwriting the existing entry)</li>
						<li><http>DELETE</http> for deleting entries from a collection</li>
					</ul>
				</ul>
			</slide>
			<slide>
				<title>Collections, Members, Entries, Media</title>
				<ul>
					<li>AtomPub's top-level concept is a <em>collection</em></li>
					<ul>
						<li>collections are used for managing and organizing <em>members</em></li>
						<li>Atom feed documents are the representation of collections</li>
						<li>collections just exist; there is no way of interacting with them</li>
					</ul>
					<li>Members of a collection can be <em>entry</em> and <em>media</em> resources</li>
					<ul>
						<li>entry resources represent metadata and are represented as Atom entries</li>
						<li>media resources can have any media type and are the data described by entries</li>
						<li>a <em>media link entry</em> is an entry associated with a member</li>
					</ul>
				</ul>
			</slide>
			<slide>
				<title>Atom/AtomPub Data Model</title>
				<img src="atom-data-model.png" style="height : 75% ; margin : 2% ; " title="Atom/AtomPub Data Model"/>
			</slide>
			<slide>
				<title>Protocol Summary</title>
					<table border="1" cellpadding="20" style="width : 90% ; margin : 2% ; ">
						<thead>
							<tr valign="top">
								<th>Resource</th>
								<th>HTTP Method</th>
								<th>Representation</th>
								<th>Description</th>
							</tr>
						</thead>
						<tbody>
							<tr valign="top">
								<td>Introspection</td>
								<td>
									<http>GET</http>
								</td>
								<td><link href="atom-service-documents">Atom Service Document</link></td>
								<td>Enumerates a set of collections and lists their URIs and other information about the collections</td>
							</tr>
							<tr valign="top">
								<td>Collection</td>
								<td>
									<http>GET</http>
								</td>
								<td>Atom Feed</td>
								<td>A list of member of the collection (this may be a subset of all entries in the collection)</td>
							</tr>
							<tr valign="top">
								<td>Collection</td>
								<td>
									<http>POST</http>
								</td>
								<td>Atom Entry</td>
								<td>Create a new entry in the collection</td>
							</tr>
							<tr valign="top">
								<td>Member</td>
								<td>
									<http>GET</http>
								</td>
								<td>Atom Entry</td>
								<td>Get the Atom Entry</td>
							</tr>
							<tr valign="top">
								<td>Member</td>
								<td>
									<http>PUT</http>
								</td>
								<td>Atom Entry</td>
								<td>Update the Atom Entry</td>
							</tr>
							<tr valign="top">
								<td>Member</td>
								<td>
									<http>DELETE</http>
								</td>
								<td>n/a</td>
								<td>Delete the Atom Entry from the collection</td>
							</tr>
						</tbody>
					</table>
			</slide>
			<slide id="collection-management">
				<title>Collection Management</title>
				<ul>
					<li>Managing collections is outside the scope of AtomPub</li>
					<ul>
						<li>AtomPub allows interactions with existing collections</li>
						<li>Collection management is inaccessible or using a proprietary protocol</li>
					</ul>
					<li><q>Metacollections</q> (collections of collections) can extend AtomPub</li>
					<ul>
						<li>each member in a metacollection corresponds with a collection</li>
						<li>accessing a metacollection means managing collections</li>
						<li>AtomPub's existing features can be reused for collection management</li>
					</ul>
					<li>Ongoing discussion in the Atom community</li>
					<ul>
						<li>currently there is no widely established method</li>
					</ul>
				</ul>
			</slide>
			<slide id="atom-service-documents">
				<title>Service Documents</title>
				<blockquote>Service Documents represent server-defined groups of Collections, and are used to initialize the process of creating and editing resources.</blockquote>
				<ul>
					<li>The <q>real</q> top-level construct of AtomPub is the <em>workspace</em></li>
					<ul>
						<li>collections on a server are organized into different workspaces</li>
						<li>workspaces have no AtomPub semantics and no operations can be performed on them</li>
					</ul>
					<li>Service documents list constraints on the members of collections</li>
					<ul>
						<li><atom>accept</atom> specifies a comma-separated list of media ranges (with <atom>entry</atom> as special value)</li>
						<li><atom>categories</atom> defines the list of categories that can be applied to members (can be <atom>fixed</atom>)</li>
						<li>AtomPub servers are likely to reject operations not satisfying these constraints</li>
					</ul>
				</ul>
			</slide>
			<slide>
				<title>Service Document Example</title>
				<listing src="atom-service.xml"/>
			</slide>
			<slide id="atom-category-documents">
				<title>Category Documents</title>
				<ul>
					<li>Categories are important for creating and reading entries</li>
					<ul>
						<li>they may contain metadata using any classification scheme</li>
					</ul>
					<li><link href="atom-service-documents"/> contain a list of allowed categories</li>
					<li>AtomPub defines a document format for standalone category documents</li>
					<ul>
						<li>a useful interface between AtomPub systems and other systems using classification schemes</li>
						<li>REST makes it important to make relevant resources accessible</li>
					</ul>
				</ul>
			</slide>
			<slide>
				<title>Category Document Example</title>
				<listing src="atom-category.xml"/>
			</slide>
		</part>
		<part>
			<title>Extending Atom/AtomPub</title>
			<slide>
				<title>Atom/AtomPub as Foundation</title>
				<ul>
					<li>Atom/AtomPub can be used as a foundation</li>
					<ul>
						<li>apply the methodology of <link href="restful-ws-design"/></li>
						<li>identify missing representations/links/states</li>
						<li>add these to the Atom/AtomPub model</li>
					</ul>
					<li>Atom has a well-defined extension model (sort of)</li>
					<ul>
						<li><em>foreign markup</em> must be silently ignored by Atom processors</li>
						<li><em>foreign markup</em> is not allowed to change the semantics of Atom markup</li>
						<li>every Atom extension must be well-behaving with plain Atom processors</li>
					</ul>
					<li>Atom can serve as a good example for extensible markup</li>
					<ul>
						<li>if you're not using Atom, consider using <a href="http://tools.ietf.org/html/rfc4287#section-6">Atom's extension model</a></li>
					</ul>
				</ul>
			</slide>
			<slide id="restful-ws-design">
				<title>RESTful Web Service Design</title>
				<ul>
					<li>URIs are used for <link href="identification-constraint">resource identification</link></li>
					<li>HTTP's methods are used as the <link href="interface-constraint">uniform interface</link></li>
					<li><link href="self-describing-constraint">Representations</link> can use any syntax and structure</li>
					<li><link href="hypermedia-constraint">Hypermedia</link> is based on links in representations</li>
					<li>Use transaction resources to create <link href="stateless-constraint">stateless interactions</link></li>
				</ul>
			</slide>
			<slide>
				<title>RESTful Web Service Design Procedure</title>
				<ol>
					<li>Figure out the data set</li>
					<li>Split the data set into resources</li>
					<li><link href="identification-constraint">Name the resources with URIs</link></li>
					<li>Expose a subset of the <link href="interface-constraint">uniform interface</link></li>
					<li><link href="self-describing-constraint">Design the representation(s)</link> accepted from the client</li>
					<li><link href="self-describing-constraint">Design the representation(s)</link> served to the client</li>
					<li><link href="hypermedia-constraint">Design hypermedia integration</link> with other resources</li>
					<li>Figure out <link href="stateless-constraint">the normal control flow</link></li>
					<li>Figure out error conditions</li>
				</ol>
				<ul>
					<li>(This is the ROA methodology)</li>
				</ul>
			</slide>
			<slide>
				<title>Watch Caching</title>
				<ul>
					<li>Decent HTTP libraries have built-in caching</li>
					<ul>
						<li>caching can also be implemented by proxies or reverse proxies</li>
					</ul>
					<li>HTTP has various ways to control caching</li>
					<ul>
						<li><http>Expires</http> set an expiration data on a response</li>
						<li><http>Cache-Control</http> for various cache control directives</li>
						<li><http>ETag</http> for uniquely identifying a resource version</li>
					</ul>
					<li>Caching allows <em>Conditional <http>GET</http>s</em></li>
					<ul>
						<li><http>If-Modified-Since</http> is conditional based on the <http>Last-Modified</http> date</li>
						<li><http>If-None-Match</http> is conditional based on the <http>ETag</http> label</li>
					</ul>
				</ul>
			</slide>
		</part>
		<part>
			<title>REST Tools</title>
			<slide>
				<title>Toolboxes and Frameworks</title>
				<ul>
					<li>Toolboxes contain a number of low-level tools</li>
					<ul>
						<li>tools for essential functionality (HTTP, URI, XML)</li>
						<li>add-ons for frequent tasks (HTML tidying, XML validation, language tag parsing)</li>
						<li>diagnostic and test tools (HTTP monitoring, protocol validators)</li>
					</ul>
					<li>Frameworks provide programming/structuring support</li>
					<ul>
						<li>frameworks encourage and support a certain coding style and structure</li>
						<li>REST focuses on exposing uniform interfaces and various media types</li>
						<li>code should be structured by representation, not by function</li>
					</ul>
				</ul>
			</slide>
			<slide>
				<title>REST Frameworks</title>
				<ul>
					<li>JAX-RS</li>
					<li>RESTlet (covers any REST, not just RESTful HTTP)</li>
					<li>Ruby on Rails</li>
					<li>Django</li>
					<li>GData</li>
				</ul>
			</slide>
			<slide>
				<title>Poster</title>
				<img style="height : 75% ; margin : 2% ; " src="poster.png" href="https://addons.mozilla.org/en-US/firefox/addon/2691"/>
			</slide>
		</part>
	</presentation>  
</hotspot>
