<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://microformats.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CerelTvimo</id>
	<title>Microformats Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://microformats.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=CerelTvimo"/>
	<link rel="alternate" type="text/html" href="https://microformats.org/wiki/Special:Contributions/CerelTvimo"/>
	<updated>2026-04-06T03:08:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://microformats.org/wiki/index.php?title=rest-proposal-preso&amp;diff=36795</id>
		<title>rest-proposal-preso</title>
		<link rel="alternate" type="text/html" href="https://microformats.org/wiki/index.php?title=rest-proposal-preso&amp;diff=36795"/>
		<updated>2009-01-03T09:51:47Z</updated>

		<summary type="html">&lt;p&gt;CerelTvimo: pasdeldarb&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;dronro&lt;br /&gt;
= XHTML-REST =&lt;br /&gt;
The purpose of this presentation is to describe and justify a proposal for using microformants to constrain REST implementations.&lt;br /&gt;
&lt;br /&gt;
= Web Services: RPC vs. REST =&lt;br /&gt;
* RPC: Remote Procedure Calls&lt;br /&gt;
** URIs are method names&lt;br /&gt;
** XML is the arguments format&lt;br /&gt;
** Implemented in [http://www.xmlrpc.com/ XML-RPC] and [http://www.w3schools.com/soap/soap_intro.asp SOAP]&lt;br /&gt;
* [http://www.xfront.com/REST-Web-Services.html REST]: Representational State Transfer&lt;br /&gt;
** Nouns are URIs, verbs are HTTP: GET, PUT, POST, DELETE&lt;br /&gt;
** XML documents are state information&lt;br /&gt;
** Implemented at [http://www.xml.com/pub/a/2005/09/21/atom-store-web-database.html?page=2 Atom], [http://www.oreillynet.com/pub/wlg/3005 Amazon] (sorta)&lt;br /&gt;
&lt;br /&gt;
= Advantages of REST over RPC/SOAP =&lt;br /&gt;
* Much simpler to design&lt;br /&gt;
** Easy to identify appropriate nouns&lt;br /&gt;
** Don't need to define methods (verbs)&lt;br /&gt;
** Don't need a complete object model&lt;br /&gt;
* Easier to learn/invoke&lt;br /&gt;
** Always know what a URI means&lt;br /&gt;
** Need not 'tunnel' XML inside XML&lt;br /&gt;
&lt;br /&gt;
= Challenges of REST =&lt;br /&gt;
;Discoverability: No standard way to find services&lt;br /&gt;
;Interoperability: Too many incompatible ways to encode links, data&lt;br /&gt;
;Extensability: What if your schema isn't 100% right?&lt;br /&gt;
;Comprehensability: What the heck does &amp;quot;state transfer&amp;quot; mean?&lt;br /&gt;
&lt;br /&gt;
= Solution, Part I-A: XHTML =&lt;br /&gt;
* Use [http://www.w3.org/TR/xhtml-basic XHTML Basic] instead of XML&lt;br /&gt;
* Don't need a rigid schema&lt;br /&gt;
* No namespaces; free to extend as needed&lt;br /&gt;
* Everyone (in this space) can write it&lt;br /&gt;
* Everything (in the world) can read it&lt;br /&gt;
&lt;br /&gt;
= Solution, Part I-B: XHTML Microformats =&lt;br /&gt;
* [http://tantek.com/presentations/2005/06/what-are-microformats/ microformats]: Add 'semantic salt' to XHTML&lt;br /&gt;
** Annotate existing XHTML tags with meaning&lt;br /&gt;
** Machine-parseable yet human-readable&lt;br /&gt;
* Links as ''&amp;lt;a href=&amp;gt;'' and ''&amp;lt;form action=&amp;gt;''&lt;br /&gt;
* Lists as [http://microformats.org/wiki/xoxo XOXO]: eXtensible Open XHTML Outlines&lt;br /&gt;
** ol, dl, ul&lt;br /&gt;
** Work like Mac OS X [http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Concepts/XMLPListsConcept.html property lists]&lt;br /&gt;
* CSS classes to reflect semantics&lt;br /&gt;
&lt;br /&gt;
= Solution, Part II: Browser clients =&lt;br /&gt;
* Makes testing &amp;amp; documentation trivial&lt;br /&gt;
** The API is the documentation is the format&lt;br /&gt;
* Use subset of REST supported by browsers&lt;br /&gt;
** GET http://host/uri&lt;br /&gt;
** GET http://host/uri?query=string...&lt;br /&gt;
** POST http://host/uri?key=value...&lt;br /&gt;
* encode input data in urls, not XML docs&lt;br /&gt;
&lt;br /&gt;
= Solution, Part III-A: Web as database =&lt;br /&gt;
* CRUD: Create, Retrieve, Update, Delete&lt;br /&gt;
* Structured UR'''L'''s vs. Opaque UR'''I'''s&lt;br /&gt;
** http://host:port/base/table/record&lt;br /&gt;
* Note: need not reflect actual database&lt;br /&gt;
** Synthetic &amp;quot;user model&amp;quot; for public API purposes&lt;br /&gt;
** But, an easy way to start (cf. [http://www.rubyonrails.org/ Ruby on Rails])&lt;br /&gt;
&lt;br /&gt;
= Solution, Part III-B: Web as database=&lt;br /&gt;
* ''base'': defines service&lt;br /&gt;
** GET base?query # search across all tables&lt;br /&gt;
* ''table'': collection of URLs with same schema&lt;br /&gt;
** GET table?query # search across this table&lt;br /&gt;
** URIs become primary keys for joins!&lt;br /&gt;
* ''record'': individual item, user, cart, etc.&lt;br /&gt;
** POST table?data # update record&lt;br /&gt;
&lt;br /&gt;
= Solution, Part III-C: Web as database=&lt;br /&gt;
* Special conventions&lt;br /&gt;
** GET http://host/uri?view=edit # API as editable forms&lt;br /&gt;
** GET http://host/uri?view=api # API as dt/dd descriptions&lt;br /&gt;
** GET http://host/uri?view=list # key-value as dt/dd&lt;br /&gt;
** GET http://host/uri?view=table # key-value as th/td&lt;br /&gt;
* Other verbs become queries&lt;br /&gt;
** POST table?data # create a new record [vs. PUT]&lt;br /&gt;
** POST table?delete=yes # flag for remove [vs. DELETE]&lt;br /&gt;
&lt;br /&gt;
= The 0.8% Solution for Web Services =&lt;br /&gt;
* (80% of benefit/20% of effort)^3&lt;br /&gt;
** XHTML vs. XML: 80/20&lt;br /&gt;
** GET/POST vs. REST: 80/20 x 80/20 = 64/4&lt;br /&gt;
** Database vs. freeform URIs: 80/20 x 64/4 = [http://en.wikipedia.org/wiki/Pareto_principle 51.2/0.8]&lt;br /&gt;
* Half the benefit for 1% of the effort!&lt;br /&gt;
** Maybe not everything, but the basics easily&lt;br /&gt;
** Power comes from how much you can ignore&lt;br /&gt;
&lt;br /&gt;
= Implications =&lt;br /&gt;
* The 'missing link' for REST?&lt;br /&gt;
* The 'killer app' for Ruby on Rails?&lt;br /&gt;
* The &amp;quot;[http://www.gladwell.com/tippingpoint/ tipping point]&amp;quot; for web services?&lt;br /&gt;
** Looser than XML =&amp;gt; easier compatibility &lt;br /&gt;
** Tighter than REST =&amp;gt; better interoperability &lt;br /&gt;
** Simpler than SOAP =&amp;gt; greater adoption&lt;br /&gt;
&lt;br /&gt;
= Examples (TBD) =&lt;br /&gt;
* ?view=api (dictionary of valid requests)&lt;br /&gt;
* {base,table}?query (OpenSearch)&lt;br /&gt;
* base/ (home page)&lt;br /&gt;
* table/ (section page)&lt;br /&gt;
* table?view=edit (record creation forms)&lt;br /&gt;
&lt;br /&gt;
= Examples - Records (TBD) =&lt;br /&gt;
* record/ (default view)&lt;br /&gt;
* record?view=edit (record update)&lt;br /&gt;
* record?view=list (dt/dd list)&lt;br /&gt;
* record?view=table (th/td row)&lt;br /&gt;
&lt;br /&gt;
= But Wait, There's More! =&lt;br /&gt;
* Not just for web services&lt;br /&gt;
** Do your whole website this way!&lt;br /&gt;
** [http://www.w3.org/TR/REC-CSS1 CSS classes] + styles =&amp;gt; prettified XHTML&lt;br /&gt;
** Don't Repeat Yourself ([http://www.artima.com/intv/dry.html DRY]): website == API&lt;br /&gt;
* Perfect solution for AJAX&lt;br /&gt;
** [http://en.wikipedia.org/wiki/AJAX AJAX]: Asynchronous-JavaScript-and-XML&lt;br /&gt;
** Actually, [http://epeus.blogspot.com/2005_05_01_epeus_archive.html#111588374981985824 JAH]: Just Asynchronous HTML&lt;br /&gt;
** JavaScript loves HTML; fast, only eight lines of code!&lt;br /&gt;
&lt;br /&gt;
= For More Information =&lt;br /&gt;
* Microformats http://microformats.org&lt;br /&gt;
** What are Microformats? http://tantek.com/presentations/2005/06/what-are-microformats/&lt;br /&gt;
** Discussion Lists http://microformats.org/discuss/&lt;br /&gt;
** XOXO: http://microformats.org/wiki/xoxo&lt;br /&gt;
* XHTML-REST&lt;br /&gt;
** research: http://microformats.org/wiki/rest-examples&lt;br /&gt;
** blog: http://www.opendarwin.org/~drernie/&lt;br /&gt;
** This presentation: http://microformats.org/wiki/rest-proposal-preso&lt;/div&gt;</summary>
		<author><name>CerelTvimo</name></author>
	</entry>
</feed>