rest/rex-proposal

(Difference between revisions)

Jump to: navigation, search
(Challenge #2: Only Two Verbs)
Current revision (22:38, 20 December 2008) (view source)
m (Reverted edits by BobotRocla (Talk) to last version by Tantek)
 
(8 intermediate revisions not shown.)
Line 1: Line 1:
-
= DUHPER: A Dual-Use HTML Profile Expressing REST =
+
= REX: REST-Enabled XHTML =
== The 0.8% Solution for Web Services ==
== The 0.8% Solution for Web Services ==
-
==== October 18th, 2005 ====
+
==== October 19th, 2005 ====
 +
 
 +
= What is REX? =
 +
* "Design Pattern" for Web Services
 +
** Architectural approach
 +
** Not a specific technology implementation
 +
** cf. DHTML, AJAX, REST, etc.
 +
* Specific profile for REST
 +
** XHTML microformats as the data format
 +
** Browser-compatible invocations
 +
** Human-friendly conventions
 +
** Trivial to implement with existing tools
= Web Services: The Opportunity =
= Web Services: The Opportunity =
Line 41: Line 52:
;Discoverability: No standard way to find services
;Discoverability: No standard way to find services
;Interoperability: Too many incompatible ways to encode links, data
;Interoperability: Too many incompatible ways to encode links, data
-
;Extensability: What if your schema isn't 100% right?
+
;Extensibility: What if your schema isn't 100% right?
-
;Comprehensability: What the heck does "state transfer" mean?
+
;Comprehensibility: What the heck does "state transfer" mean?
= Proposal: A Dual-Use (X)HTML Profile =
= Proposal: A Dual-Use (X)HTML Profile =
Line 67: Line 78:
= What Are Microformats? =
= What Are Microformats? =
-
* simple social conventions (rel="proflie")
+
* simple social conventions (rel="profile")
* using existing tags or brief CSS class names
* using existing tags or brief CSS class names
* to encode machine-readable semantics
* to encode machine-readable semantics
Line 76: Line 87:
* Link annotation, e.g.:
* Link annotation, e.g.:
** RelTag (Technorati): <a rel="tag" href=...>
** RelTag (Technorati): <a rel="tag" href=...>
-
** RelNoFollow (Gooogle):  <a rel="nofollow" href=...>
+
** RelNoFollow (Google):  <a rel="nofollow" href=...>
* User data
* User data
** [http://microformats.org/wiki/hcard hCard] (based on [http://www.ietf.org/rfc/rfc2426.txt vCard])
** [http://microformats.org/wiki/hcard hCard] (based on [http://www.ietf.org/rfc/rfc2426.txt vCard])
Line 99: Line 110:
   <dt>Key #1<dt>
   <dt>Key #1<dt>
   <dd><ol> <-- Array -->
   <dd><ol> <-- Array -->
-
         <li>subitem #1</li>
+
         <li>sub-item #1</li>
-
         <li>subitem #2</li>
+
         <li>sub-item #2</li>
   </ol></dd>
   </ol></dd>
  </dl>
  </dl>
= Challenge #2: Only Two Verbs =
= Challenge #2: Only Two Verbs =
-
* Overload URI with actions? No!
+
;Overload URI with actions? No!
-
* Web 2.0 is an constructive medium
+
: Web 2.0 is an constructive medium
-
* Don't store a document: ask for creation
+
;Don't store a document; ask for creation
-
** POST parent&key1=value1 => child URI
+
: POST parent&key1=value1 => child URI
-
* Don't edit document: create new revision
+
;Don't overwrite documents; update
-
** The concept of bottomless stack: each document is also a collection of its revisions, with the latest revision sitting at the top of the stack. After the number of revisions reaches the arbitrary size of the stack, oldest revisions fall off the stack into oblivion (note: size=1 and size=0 are possible, too)
+
: POST child&key1=value1 => new child URI
-
* Don't delete a document: flag for removal
+
;Don't delete a document; flag for removal
-
** POST child&shouldDelete=true
+
: POST child&shouldDelete=true
= Challenge #3: Key-Value Data =
= Challenge #3: Key-Value Data =
Line 160: Line 171:
** Discussion Lists http://microformats.org/discuss/
** Discussion Lists http://microformats.org/discuss/
** XOXO: http://microformats.org/wiki/xoxo
** XOXO: http://microformats.org/wiki/xoxo
 +
** Microformats Information: http://mydatapages.com/microformats.html
* XHTML and REST
* XHTML and REST
** research: http://microformats.org/wiki/rest-examples
** research: http://microformats.org/wiki/rest-examples
** blog: http://www.opendarwin.org/~drernie/
** blog: http://www.opendarwin.org/~drernie/
-
** This presentation: http://microformats.org/wiki/duhper-proposal-preso
+
** This presentation: http://microformats.org/wiki/rex-proposal-preso

Current revision

Contents

REX: REST-Enabled XHTML

The 0.8% Solution for Web Services

October 19th, 2005

What is REX?

Web Services: The Opportunity

Web Services: The Problem

The Answer(?): REST vs. RPC

Advantages of REST over RPC

Challenges of REST

Discoverability
No standard way to find services
Interoperability
Too many incompatible ways to encode links, data
Extensibility
What if your schema isn't 100% right?
Comprehensibility
What the heck does "state transfer" mean?

Proposal: A Dual-Use (X)HTML Profile

Three Challenges

Challenge #1: Machine-Parseability

What Are Microformats?

Kinds of Microformats

Example: hCard

<div class="vcard">
 <a class="url fn" href="http://tantek.com/">
  Tantek Çelik
 </a>
 <div class="org">Technorati</div>
</div>

Example: eXtensible Open XHTML Outlines

<dl class='xoxo'> <-- Dictionary -->
 <dt>Key #1<dt>
 <dd><ol> <-- Array -->
       <li>sub-item #1</li>
       <li>sub-item #2</li>
 </ol></dd>
</dl>

Challenge #2: Only Two Verbs

Overload URI with actions? No!
Web 2.0 is an constructive medium
Don't store a document; ask for creation
POST parent&key1=value1 => child URI
Don't overwrite documents; update
POST child&key1=value1 => new child URI
Don't delete a document; flag for removal
POST child&shouldDelete=true

Challenge #3: Key-Value Data

The 0.8% Solution for Web Services

Advantages

Implications

For More Information

rest/rex-proposal was last modified: Saturday, December 20th, 2008

Views