<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://microformats.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Agtlewis</id>
	<title>Microformats Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://microformats.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Agtlewis"/>
	<link rel="alternate" type="text/html" href="http://microformats.org/wiki/Special:Contributions/Agtlewis"/>
	<updated>2026-05-13T08:03:53Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>http://microformats.org/wiki/index.php?title=rest/rex-proposal&amp;diff=17776</id>
		<title>rest/rex-proposal</title>
		<link rel="alternate" type="text/html" href="http://microformats.org/wiki/index.php?title=rest/rex-proposal&amp;diff=17776"/>
		<updated>2006-12-19T08:58:45Z</updated>

		<summary type="html">&lt;p&gt;Agtlewis: /* For More Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= REX: REST-Enabled XHTML =&lt;br /&gt;
== The 0.8% Solution for Web Services ==&lt;br /&gt;
==== October 19th, 2005 ====&lt;br /&gt;
&lt;br /&gt;
= What is REX? =&lt;br /&gt;
* &amp;quot;Design Pattern&amp;quot; for Web Services&lt;br /&gt;
** Architectural approach&lt;br /&gt;
** Not a specific technology implementation&lt;br /&gt;
** cf. DHTML, AJAX, REST, etc.&lt;br /&gt;
* Specific profile for REST&lt;br /&gt;
** XHTML microformats as the data format&lt;br /&gt;
** Browser-compatible invocations&lt;br /&gt;
** Human-friendly conventions&lt;br /&gt;
** Trivial to implement with existing tools&lt;br /&gt;
&lt;br /&gt;
= Web Services: The Opportunity =&lt;br /&gt;
* &amp;quot;The Next Big Thing&amp;quot;&lt;br /&gt;
* Rewriting the web as a platform&lt;br /&gt;
* Foundation of [Web 2.0] businesses&lt;br /&gt;
** Architecture of participation&lt;br /&gt;
** Infrastructure for collaboration&lt;br /&gt;
* Enterprise App Integration (EAI) all over again&lt;br /&gt;
&lt;br /&gt;
= Web Services: The Problem =&lt;br /&gt;
* Can work really well when you have:&lt;br /&gt;
** Well-defined community&lt;br /&gt;
** Well-run governance&lt;br /&gt;
** Well-understood problem space&lt;br /&gt;
* Not true of the public Internet&lt;br /&gt;
* Not true of most vertical industries&lt;br /&gt;
&lt;br /&gt;
= The Answer(?): REST vs. RPC =&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 Atom], [http://www.oreillynet.com/pub/wlg/3005 Amazon] (sorta)&lt;br /&gt;
&lt;br /&gt;
= Advantages of REST over RPC =&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;
;Extensibility: What if your schema isn't 100% right?&lt;br /&gt;
;Comprehensibility: What the heck does &amp;quot;state transfer&amp;quot; mean?&lt;br /&gt;
&lt;br /&gt;
= Proposal: A Dual-Use (X)HTML Profile =&lt;br /&gt;
* Subset of REST that works with browsers&lt;br /&gt;
** XHTML Basic vs. arbitrary XML&lt;br /&gt;
** Just GET &amp;amp; POST (not PUT or DELETE)&lt;br /&gt;
** Encode URIs in hyperlinks (&amp;amp;lt;a href&amp;gt;) and forms (&amp;amp;lt;form action&amp;gt;)&lt;br /&gt;
** Inputs always key-value pairs (like database table)&lt;br /&gt;
* With CSS and AJAX, can '''be''' the website&lt;br /&gt;
** DRY = Don't Repeat Yourself&lt;br /&gt;
** Makes discovery and documentation trivial&lt;br /&gt;
&lt;br /&gt;
= Three Challenges =&lt;br /&gt;
* Is HTML Machine-Parseable?&lt;br /&gt;
* Are there really only two verbs?&lt;br /&gt;
* Can you build real apps on key-value encoding?&lt;br /&gt;
&lt;br /&gt;
= Challenge #1: Machine-Parseability =&lt;br /&gt;
* Screen scraping all over again? No!&lt;br /&gt;
* Use the &amp;quot;secret sauce&amp;quot; of &amp;quot;semantic salt&amp;quot;&lt;br /&gt;
** cf. &amp;quot;syntactic sugar&amp;quot; -- hides unpleasant details&lt;br /&gt;
** &amp;quot;semantic salt&amp;quot; -- brings out latent structure&lt;br /&gt;
* In other words, &amp;quot;[http://tantek.com/presentations/2005/06/what-are-microformats/ microformats]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
= What Are Microformats? =&lt;br /&gt;
* simple social conventions (rel=&amp;quot;profile&amp;quot;)&lt;br /&gt;
* using existing tags or brief CSS class names&lt;br /&gt;
* to encode machine-readable semantics&lt;br /&gt;
* in human-readable HTML, XHTML, or even XML&lt;br /&gt;
** cf. &amp;amp;lt;link rel&amp;gt; in Atom&lt;br /&gt;
&lt;br /&gt;
= Kinds of Microformats =&lt;br /&gt;
* Link annotation, e.g.:&lt;br /&gt;
** RelTag (Technorati): &amp;amp;lt;a rel=&amp;quot;tag&amp;quot; href=...&amp;gt;&lt;br /&gt;
** RelNoFollow (Google):  &amp;amp;lt;a rel=&amp;quot;nofollow&amp;quot; href=...&amp;gt;&lt;br /&gt;
* User data&lt;br /&gt;
** [http://microformats.org/wiki/hcard hCard] (based on [http://www.ietf.org/rfc/rfc2426.txt vCard])&lt;br /&gt;
** [http://microformats.org/wiki/hcalendar hCalendar] (based on [http://www.ietf.org/rfc/rfc2445.txt iCalendar])&lt;br /&gt;
* Data structures&lt;br /&gt;
** [http://microformats.org/wiki/xoxo XOXO] lists: ol, ul, dl&lt;br /&gt;
** [http://microformats.org/wiki/table-examples XOXT] tables: th, tr, td&lt;br /&gt;
&lt;br /&gt;
= Example: hCard =&lt;br /&gt;
* ''hCard'' class names := ''vCard'' fields&lt;br /&gt;
 &amp;amp;lt;div class=&amp;quot;vcard&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;amp;lt;a class=&amp;quot;url fn&amp;quot; href=&amp;quot;http://tantek.com/&amp;quot;&amp;gt;&lt;br /&gt;
   Tantek Çelik&lt;br /&gt;
  &amp;amp;lt;/a&amp;gt;&lt;br /&gt;
  &amp;amp;lt;div class=&amp;quot;org&amp;quot;&amp;gt;Technorati&amp;amp;lt;/div&amp;gt;&lt;br /&gt;
 &amp;amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Example: eXtensible Open XHTML Outlines =&lt;br /&gt;
* Reuse existing HTML tags&lt;br /&gt;
* Arbitrary data structure (like [http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Concepts/XMLPListsConcept.html property lists])&lt;br /&gt;
 &amp;amp;lt;dl class='xoxo'&amp;gt; &amp;amp;lt;-- Dictionary --&amp;gt;&lt;br /&gt;
  &amp;amp;lt;dt&amp;gt;Key #1&amp;amp;lt;dt&amp;gt;&lt;br /&gt;
  &amp;amp;lt;dd&amp;gt;&amp;amp;lt;ol&amp;gt; &amp;amp;lt;-- Array --&amp;gt;&lt;br /&gt;
        &amp;amp;lt;li&amp;gt;sub-item #1&amp;amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;amp;lt;li&amp;gt;sub-item #2&amp;amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;amp;lt;/ol&amp;gt;&amp;amp;lt;/dd&amp;gt;&lt;br /&gt;
 &amp;amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Challenge #2: Only Two Verbs =&lt;br /&gt;
;Overload URI with actions? No!&lt;br /&gt;
: Web 2.0 is an constructive medium&lt;br /&gt;
;Don't store a document; ask for creation&lt;br /&gt;
: POST parent&amp;amp;key1=value1 =&amp;gt; child URI&lt;br /&gt;
;Don't overwrite documents; update&lt;br /&gt;
: POST child&amp;amp;key1=value1 =&amp;gt; new child URI&lt;br /&gt;
;Don't delete a document; flag for removal&lt;br /&gt;
: POST child&amp;amp;shouldDelete=true&lt;br /&gt;
&lt;br /&gt;
= Challenge #3: Key-Value Data =&lt;br /&gt;
* Encode complex structures as XML text? No!&lt;br /&gt;
* Treat web service like a database&lt;br /&gt;
** Common classes (e.g. users, items, carts) =&amp;gt; tables&lt;br /&gt;
** Key-value dictionaries =&amp;gt; records&lt;br /&gt;
** URIs for each records =&amp;gt; primary keys&lt;br /&gt;
* Need NOT reflect actual internal database&lt;br /&gt;
** Can present a synthetic view&lt;br /&gt;
** But, makes a great starting point (cf. [http://www.rubyonrails.org/ Ruby on Rails]&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;
** XOXO vs. XML: 80/20&lt;br /&gt;
** GET/POST vs. REST: 80/20 x 80/20 = 64/4&lt;br /&gt;
** Key-Value vs. structured input: 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;
** cf. [http://intertwingly.net/slides/2005/rs/ Radical Simplification]&lt;br /&gt;
&lt;br /&gt;
= Advantages =&lt;br /&gt;
* Reuse existing semantics and structure&lt;br /&gt;
** Generally only one way to encode something&lt;br /&gt;
* Reduce possible degrees of freedom&lt;br /&gt;
** Simplifies design, improves interoperability&lt;br /&gt;
** Focus on the 80% where agreement is easy&lt;br /&gt;
* Increase learnability&lt;br /&gt;
** Everyone (in this space) can write it&lt;br /&gt;
** Everything (in the world) can read it&lt;br /&gt;
** The API is the documentation is the format&lt;br /&gt;
&lt;br /&gt;
= Implications =&lt;br /&gt;
* Is this the &amp;quot;[http://www.gladwell.com/tippingpoint/ tipping point]&amp;quot;?&lt;br /&gt;
** The 'LDAP' of web services?&lt;br /&gt;
** The 'missing link' for REST?&lt;br /&gt;
** The 'killer app' for Ruby on Rails?&lt;br /&gt;
* Why?&lt;br /&gt;
** Looser than XML =&amp;gt; allows innovation &lt;br /&gt;
** Tighter than REST =&amp;gt; encourages interoperability &lt;br /&gt;
** Simpler than SOAP =&amp;gt; enables rapid adoption&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;
** Microformats Information: http://mydatapages.com/microformats.html&lt;br /&gt;
* XHTML and 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/rex-proposal-preso&lt;/div&gt;</summary>
		<author><name>Agtlewis</name></author>
	</entry>
</feed>