<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>linked, not bound</title>
	<atom:link href="http://linkednotbound.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://linkednotbound.net</link>
	<description>web-inspired software architecture</description>
	<lastBuildDate>Mon, 27 Feb 2012 02:34:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='linkednotbound.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>linked, not bound</title>
		<link>http://linkednotbound.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://linkednotbound.net/osd.xml" title="linked, not bound" />
	<atom:link rel='hub' href='http://linkednotbound.net/?pushpress=hub'/>
		<item>
		<title>Hypermedia is an Event Filter</title>
		<link>http://linkednotbound.net/2011/01/31/hypermedia-is-an-event-filter/</link>
		<comments>http://linkednotbound.net/2011/01/31/hypermedia-is-an-event-filter/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 03:00:48 +0000</pubDate>
		<dc:creator>Andrew Wahbe</dc:creator>
				<category><![CDATA[Hypermedia]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://linkednotbound.net/?p=92</guid>
		<description><![CDATA[In an earlier post, I examined multiple definitions of the term “hypermedia”. A key aspect shared by all those definitions was that hypermedia is interactive – an entity interacting with the system is able to effect change through some sort of input or action. In fact, Roy Fielding summarizes “hypertext” as data-guided controls. Unfortunately, little [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=92&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In an <a href="/2010/08/25/m2m-hypermedia/" title="Machine to Machine Hypermedia">earlier post</a>, I examined multiple definitions of the term “hypermedia”. A key aspect shared by all those definitions was that hypermedia is interactive – an entity interacting with the system is able to effect change through some sort of input or action. In fact, Roy Fielding summarizes “hypertext” as <em>data-guided controls</em>. Unfortunately, little focus is typically given to input event processing in the context of REST even though the style offers some definite advantages in this area.</p>
<p>In <a href="/2010/07/19/self-descriptive-hypermedia/" title="Self-Descriptive Hypermedia">another post</a>, I discussed a comparison of various alternative architectures for the Web found in <a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_2_1" title="REST: Data Elements">section 5.2.1 of Roy Fielding’s dissertation</a>. The focus of this analysis was the transfer of information from server to client as the movement of data to the processor distinguishes REST from other architectural styles that move processing agents to the data.
</p>
<p>In this post, I will re-examine these alternatives, extending the analysis to the information flowing from client to server and the protocols used to exchange information. By doing so, I hope to clarify the advantages provided by REST for input event processing.</p>
<p><span id="more-92"></span></p>
<h3>Option 1: Client-Server</h3>
<p>The first alternate architecture is based on a client-server model where <em>information is rendered on the server and the resulting image is sent to the client</em>. As <a href="/2010/07/19/self-descriptive-hypermedia/" title="Self-Descriptive Hypermedia">discussed previously</a>, this provides data encapsulation and decoupling at the expense of bandwidth usage and increased server-side processing. Also, the creation of secondary clients such as spiders is inhibited.</p>
<p>Now, let’s turn our attention to input processing: in such a system, the client has no knowledge of what input events are relevant to the application and what effect they might have. The only information the server has provided the client is an image to display on the screen – the client has no idea where the links or other input controls are located. There is nothing to tell it what areas of the screen respond to mouse-over events, clicks, etc. And so every mouse or keyboard event must be communicated to the server just in case they are relevant. This results in wasted bandwidth, and wasted server-side processing of irrelevant input events. The responsiveness of the client would likely seem quite slow as well because even the most minor change to the display would require a round trip to the server.</p>
<h3>Option 2: Mobile-Object</h3>
<p>The second option is a mobile-object style architecture where <em>the server sends a combination of both the data and a rendering engine (i.e. processing logic or code) to the client.</em> Here, the client-side events can be filtered and processed by the mobile code running on the client, allowing communication with the server to take place only when it is truly needed by the application. The processing of an event might result in an update to the rendered image based on local processing and in other cases result in a request to the server, though many events could simply be ignored.</p>
<p>The client also has the ability to establish a connection with the server and communicate using virtually any protocol as the protocol stack is included in the code that comprises the mobile-object and the communication protocol can be optimized for individual applications (though this flexibility could not be afforded to the protocol used to download the initial mobile object). Thus client-to-server bandwidth-usage, user-perceived latency and server-side processing are optimized. This comes at the expense of visibility as intermediaries are not able to interpret the information exchanged between the client and server and thus cannot perform any processing on the data or optimization of the communication flows (e.g. caching).</p>
<h3>Option 3: Raw Hyper-Data</h3>
<p>In the third architecture <em>the server sends the raw data to the client along with a media type that indicates the data format allowing the client to choose a rendering engine for the data.</em> Here, the downloaded data not only drives the rendering of output, but also provides instructions to the client on how to interpret input events –  ignoring irrelevant events, handling events locally where possible and generating requests to the server for more data in other cases. Thus the client can be described as possessing an <em>interactive rendering engine.</em></p>
<p>Unlike Option 2, these rendering and input-handling instructions do not take the form of downloaded code, instead they are embedded in the data as <em>declarative controls</em>. Control data informs the rendering engine on how to solicit input events from the user, for example, indicating that a certain string of text should be clickable and should therefore be rendered in a special way (underlined and blue) so that it (perceivably) <a title="Wikipedia: Affordance" href="http://en.wikipedia.org/wiki/Affordance">affords</a> clicking. The control data also tells the rendering engine that mouse click events targeted at the area of the screen occupied by the text must be processed in a certain way, for example, by downloading new data to drive the rendering engine.</p>
<p>In this architecture, mobile code implementing a protocol stack cannot be downloaded and run by the client. Instead, communication must be restricted to a protocol that is already understood by the client. The control data indicates how to construct the data to be sent to the server in requests. This request data may be constructed from other control data (e.g. a logical name for the next set of data to download performing a similar function to a URI) or from data received from the user via previous input events (e.g. keyboard input event).</p>
<p>This architecture has some of the same benefits as the mobile code architecture in that the client is able to process events locally rather than forwarding them all to the server. However, in this case event processing is restricted to the set of control types that can be expressed by the data format. Also, just as this architecture requires the client and server to pre-agree on a data format (inhibiting data encapsulation), they must also pre-agree on a set of data transfer protocols (restricting interoperability). However, as discussed in my earlier post, this comes with the advantage that because data is downloaded instead of code, not only is less bandwidth likely used but also the client has more flexibility – it is not restricted to running the code; it can perform alternate functions such as index spidering without actually rendering the data. The fact that the control information is embedded in the data enhances this capability allowing these alternate non-rendering clients to not only understand how the data would be rendered as output but also how the interactive rendering engine would process input events.</p>
<h3>REST</h3>
<p>As discussed in  <a href="/2010/07/19/self-descriptive-hypermedia/" title="Self-Descriptive Hypermedia">my earlier post</a>, Option 3 is not quite REST.  REST additionally requires that data be transferred in a representation format “matching one of an evolving set of standard data types, selected dynamically based on the capabilities or desires of the recipient and the nature of the resource”, addressing the data encapsulation issues in Option 3. REST also requires the use of an evolving set of standard transfer protocols (that can all be mapped to a uniform interface). This addresses the issue in Option 3 where the client and server are required to pre-agree on a (potentially non-standard) protocol. In REST, a resource is referenced by a URI that uses a standard URI scheme. The URI scheme tells the client which standard protocol to use; this reduces pre-agreement between client and server to an agreement on a common space of standard protocols. This use of URIs to identify resources also allows the data format standards and the data transfer protocols to evolve separately (Larry Masinter has published <a title="Orthogonality of Specifications" href="http://www.w3.org/QA/2009/06/orthogonality_of_specification.html">a great discussion of this principle</a> and it is also discussed in the first “rule” in Roy Fielding’s <a title="Untangled: REST APIs must be hypertext-driven" href="http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven">guidelines on REST APIs</a>). Thus, the use of standard formats and transfer protocols allows REST to address the client-server coupling issues of Option 3.</p>
<p>REST also adds the use of code-on-demand to Option 3, allowing scripts and bytecode to be used as representation formats. This allows REST to achieve many of the benefits of Option 2. While Option 3 restricts the client’s rendering and input processing capabilities to what can be expressed by the data format, REST allows scripts and embedded objects to extend the client’s capabilities. Increased use of code-on-demand comes at the cost of decreased visibility – a tradeoff that must be kept in mind when designing a system. Practically, the more script-driven a web site is, the less non-browser clients (spiders, intermediaries, analytics and authoring tools, etc.) can do with it.</p>
<p> It should be noted that REST does not relax the constraints that require standard formats and protocols in the context of code-on-demand. For example, HTTP is used for communication performed by browser scripts in an AJAX application. To some, this may seem like a disadvantage, providing Option 2 with more flexibility than REST. However, standard protocols have some clear advantages over custom protocols. While I will leave a detailed discussion of this point for a future post, the advantages primarily come from the ability of intermediaries to act on communications, providing services such as caching and content transformation.</p>
<p>In <a href="/2010/12/01/web-linking/" title="Web Linking">my last post</a>, I asked if adding links to data was sufficient to turn it into hypermedia. It seems that there is more to hypermedia than links; <em>hypermedia is an event filter</em>. In a RESTful system, input events from the user are processed by the client according to the controls specified by the currently-loaded hypermedia document. These controls determine if an event is simply dropped, transforms the document or application state in some way, or is translated into a request on the uniform interface for a new document to be loaded. Embedding controls in the data transfered to the client offers performance benefits over a client-server model that transmits all events to the server, and visibility benefits over a mobile-code architecture where downloaded code processes events. Controls are more than links; hypermedia is more than linked data.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linkednotbound.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linkednotbound.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linkednotbound.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linkednotbound.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linkednotbound.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linkednotbound.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linkednotbound.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linkednotbound.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linkednotbound.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linkednotbound.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linkednotbound.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linkednotbound.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linkednotbound.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linkednotbound.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=92&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linkednotbound.net/2011/01/31/hypermedia-is-an-event-filter/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbff68c4b9ecf3713dce0ef2e2e10856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aawahbe</media:title>
		</media:content>
	</item>
		<item>
		<title>Web Linking</title>
		<link>http://linkednotbound.net/2010/12/01/web-linking/</link>
		<comments>http://linkednotbound.net/2010/12/01/web-linking/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 14:56:36 +0000</pubDate>
		<dc:creator>Andrew Wahbe</dc:creator>
				<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Hypermedia]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://linkednotbound.net/?p=74</guid>
		<description><![CDATA[A couple months ago, Mark Nottingham’s Web Linking internet draft made its way to RFC status. This is a pretty significant specification for the web. It does three key things: It provides a generic definition of a “link”; It establishes a registry for link relations; and It defines the HTTP link header. The first point [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=74&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A couple months ago, Mark Nottingham’s Web Linking internet draft made its way to <a title="Web Linking RFC" href="http://tools.ietf.org/html/rfc5988">RFC status</a>. This is a pretty significant specification for the web. It does three key things:</p>
<ol>
<li>It provides a generic definition of a “link”;</li>
<li>It establishes a <a title="IANA Link Relations Registry" href="http://www.iana.org/assignments/link-relations/link-relations.xhtml">registry for link relations</a>; and</li>
<li>It defines the HTTP link header.</li>
</ol>
<p>The first point is one of those things that surprisingly hadn’t been done before – at least as far as I know anyways. Sure, links have been defined in the context of specific formats, and the semantic web has a fairly generic definition of a link, but the web linking RFC provides an application and serialization agnostic definition, which is a pretty useful thing to have.</p>
<p><span id="more-74"></span>The RFC defines a link as a <em>typed connection between two resources</em>: a context resource and a target resource. The resources are identified by URIs (well, technically <a title="Internationalized Resource Identifiers RFC" href="http://tools.ietf.org/html/rfc3987">IRIs</a>) and the type is identified by a link relation. A link relation identifier can be one of the relation types from the registry established by the RFC, or it can be an extension (non-registered) relation identified by a URI. The type defines the semantics of the link. For example, the “stylesheet” relation means that the target resource is a stylesheet for the context resource.</p>
<p>The HTTP link header provides a mechanism for specifying links in an HTTP response when the representation format being used does not natively support them. For example, a response to an HTTP GET request for a PNG image could use the link header to indicate that the resource is linked to other resources in various ways.</p>
<p>Now some might not immediately see the benefit of this specification. There are tons of (so-called) “RESTful” APIs out there stuffing links in JSON data structures all over the web right now. For example, what about the following HTTP request:<br />
<code><br />
GET /someresource.json HTTP/1.1<br />
Host: example.com<br />
</code><br />
and response:<br />
<code><br />
HTTP/1.1 200 OK<br />
Content-Type: application/json<br />
<br />
{ “node” : {<br />
&nbsp;&nbsp;“id” : “http://example.com/identifiers/12345”,<br />
&nbsp;&nbsp;“next” : “http://example.com/nextres.json”,<br />
&nbsp;&nbsp;“value” : “http://other-example.org/somelink.html”<br />
}}<br />
</code><br />
Well this data structure seems to contain 3 URIs – but does it contain three links? It’s hard to tell without knowing more about the data format, but if we make some assumptions from the names, the properties demonstrate 3 distinct uses of URIs. The “id” property uses a URI as a unique identifier, similar to how URIs are used in XML namespace identifiers or in the Atom id element. The “value” property is just a string, it could be anything, but in this example that string happens to contain an http URI – one might even argue that this isn’t really a URI at all, but just a string that looks like one. The “next” property is the only link out of the three, providing the URI of another node that follows the one we are looking at (i.e. the nodes form a linked-list).</p>
<p>Of course, if the property names were “x”, “y” and “z” we’d have a much harder time figuring this out. This is an example of where serving data with a content-type of “application/json” (or “application/xml”) falls short. You can’t tell how to interpret the data just by looking at the response – you need some extra information or documentation to understand it. This is where <a title="Self-Descriptive Hypermedia" href="/2010/07/19/self-descriptive-hypermedia/">self-descriptive messages</a> are critical – the response would be self-descriptive if the data format had its own media type (e.g. “application/node”) with an associated specification that described how to interpret the individual properties. This specification would define the semantics of the link relation associated with the “next” property (i.e. this format doesn’t use a generic link construct with an extensible relation field), allowing the consumer to follow the link to fetch the following node in the list. While this format specification could also be considered “extra information or documentation” the difference is that it isn’t specific to the URIs you are interacting with (in a linked environment you can find yourself interacting with new URIs that you hadn’t expected) and relevant specification can easily be identified via the communicated media type.</p>
<p>This hopefully makes it clear that it is not sufficient for data to simply contain URIs for it to be “linked”. There must be a specification of the format that identifies those URIs as links, and either defines the link semantics or how they can be determined. The link might be part of a generic link construct like the Atom and HTML &lt;link&gt; elements, referencing a relation from the link relation registry that provides the link semantics. Alternatively, the link semantics might be defined in the data format, as was the case in the “next” property from our example.</p>
<p>The Web Linking RFC is really useful because you don’t have to go and redefine what a link is in every data format you define – you can reference the definition in the RFC. The specific link types in your format can reference the definitions in the link relation registry. For example the definition of the format used in our example above could simply reference the “next” relation in the registry. Alternatively, a generic link serialization could be used that leaves the relation as a field allowing any relation in the registry (or a proprietary relation) to be used.</p>
<p>For example, the response in the example above could be re-defined as follows:<br />
<code><br />
HTTP/1.1 200 OK<br />
Content-Type: application/node<br />
<br />
{ “node” : {<br />
&nbsp;&nbsp;“id” : “http://example.com/identifiers/12345”,<br />
&nbsp;&nbsp;“links” : [ {<br />
&nbsp;&nbsp;&nbsp;&nbsp;“href” : “http://example.com/nextres.json”,<br />
&nbsp;&nbsp;&nbsp;&nbsp;“rel” : “next”<br />
&nbsp;&nbsp;} ],<br />
&nbsp;&nbsp;“value” : “http://other-example.org/somelink.html”<br />
}}<br />
</code><br />
(<b>Update:</b> I changed the content type here from &#8220;application/json&#8221; to the fictitious &#8220;application/node&#8221; media type &#8212; see Nathan&#8217;s comment below. We assume that the specification for this type properly defines the &#8220;links&#8221; field as an array of links.)<br />
<br />
Alternatively, the link header could be used as follows:<br />
<code><br />
HTTP/1.1 200 OK<br />
Content-Type: application/json<br />
Link: &lt;http://example.com/nextres.json&gt;; rel=”next”<br />
<br />
{ “node” : {<br />
&nbsp;&nbsp;“id” : “http://example.com/identifiers/12345”,<br />
&nbsp;&nbsp;“value” : “http://other-example.org/somelink.html”<br />
}}<br />
</code><br />
However, this has the disadvantage of separating the link from the content – if you store the body somewhere (e.g. to disk) you lose the link information that was sent along with it. It also means that you can’t communicate the link information if you communicate the structure using a protocol that doesn’t support the link header (e.g. FTP). It is best to embed the link information in the response body unless the format doesn’t allow it (e.g. it’s an image).</p>
<p>I hope it’s clear that the Web Linking RFC makes it really easy to add links to any resource on the web. But does this mean that any resource can be turned into hypermedia? Is a linked resource the same thing as hypermedia? As discussed in <a title="Machine-to-Machine Hypermedia" href="/2010/08/25/m2m-hypermedia/">my last post</a>, we can summarize “hypermedia” as <em>data-guided controls</em>. Is adding links to data sufficient to provide “data-guided controls”? This is something I’ll continue to explore in future posts.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linkednotbound.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linkednotbound.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linkednotbound.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linkednotbound.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linkednotbound.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linkednotbound.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linkednotbound.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linkednotbound.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linkednotbound.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linkednotbound.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linkednotbound.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linkednotbound.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linkednotbound.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linkednotbound.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=74&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linkednotbound.net/2010/12/01/web-linking/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbff68c4b9ecf3713dce0ef2e2e10856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aawahbe</media:title>
		</media:content>
	</item>
		<item>
		<title>Machine-to-Machine Hypermedia</title>
		<link>http://linkednotbound.net/2010/08/25/m2m-hypermedia/</link>
		<comments>http://linkednotbound.net/2010/08/25/m2m-hypermedia/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 06:38:14 +0000</pubDate>
		<dc:creator>Andrew Wahbe</dc:creator>
				<category><![CDATA[Hypermedia]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://linkednotbound.net/?p=57</guid>
		<description><![CDATA[Most developers and architects trying to create new RESTful hypermedia formats today are focused on “machine-to-machine” systems where the client is not driven by a user interface (UI). Hypermedia formats already exist for UI-driven clients. There’s obviously HTML plus a whole family of standards (SVG, SMIL, etc.) for graphical UIs and for voice UIs there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=57&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Most developers and architects trying to create new RESTful hypermedia formats today are focused on “machine-to-machine” systems where the client is not driven by a user interface (UI). Hypermedia formats already exist for UI-driven clients. There’s obviously HTML plus a whole family of standards (SVG, SMIL, etc.) for graphical UIs and for voice UIs there are standards such as VoiceXML. While there are many great examples of hypermedia formats for UI-driven clients, it’s not even clear what “hypermedia” actually means outside of the context of a UI.</p>
<p>Let’s take a look at the <a href="http://en.wikipedia.org/wiki/Hypermedia">Wikipedia definition of “hypermedia”</a>:</p>
<blockquote><p><strong>Hypermedia</strong><strong></strong> is used as a logical extension of the term <a href="http://en.wikipedia.org/wiki/Hypertext">hypertext</a> in which graphics, audio, video, plain text and <a href="http://en.wikipedia.org/wiki/Hyperlink">hyperlinks</a> intertwine to create a generally non-linear medium of information.This contrasts with the broader term <a href="http://en.wikipedia.org/wiki/Multimedia"><em>multimedia</em></a>, which may be used to describe non-interactive linear presentations as well as hypermedia.</p></blockquote>
<p>This seems to define hypermedia as an extension of media designed for human consumption. So does it make sense to use the term hypermedia for something that isn’t consumed through some sort of user interface?</p>
<p><span id="more-57"></span>Perhaps hypermedia has a slightly different definition in the context of REST. Instead, let’s look at the <a title="Fielding's Dissertation Section 4.1.3" href="http://www.ics.uci.edu/~fielding/pubs/dissertation/web_arch_domain.htm#sec_4_1_3">definition of distributed hypermedia in Roy Fielding’s dissertation</a>:</p>
<blockquote><p>Hypermedia is defined by the presence of application control information embedded within, or as a layer above, the presentation of information. Distributed hypermedia allows the presentation and control information to be stored at remote locations.</p></blockquote>
<p>In a more recent <a title="REST and Relaxation" href="http://roy.gbiv.com/talks/200711_REST_ApacheCon.pdf">2008 ApacheCon presentation</a>, Fielding defines hypertext as:</p>
<blockquote><p>The simultaneous presentation of information and controls such that the information becomes the affordance through which the user obtains choices and selects actions.</p></blockquote>
<p>and then sums it up as:</p>
<blockquote><p>Hypertext = data-guided controls</p></blockquote>
<p>This is interesting &#8212; “controls” implies the ability to effect change in an application through some sort of input or action. In the field of design, the term “<a title="Don Norman: Affordances and Design" href="http://www.jnd.org/dn.mss/affordances_and.html">affordance</a>” means the set of possible actions that a user can take, though it is more often used to mean the set of possible actions that the user is made aware of – the “perceived affordance”. An on-screen control “affords clicking” if the user believes that this is a useful and meaningful action to take.</p>
<p>In a browser, hypertext determines what text and graphics are presented on the computer screen as well as what on-screen controls are made available. Realizing controls not only requires communication to the user of what areas of the screen can be clicked or respond to keyboard input, but also effecting the response to this input. The input should of course be meaningful as the user is being made to perceive it as such.</p>
<p>In short, the hypertext informs the browser how to turn input and output resources (a screen, keyboard and mouse) into interactive information. This is actually very much in line with the Wikipedia definition we started with which, in addition to the <em>non-linear </em>nature of hypermedia, identifies <em>interactivity</em> as a characteristic which separates hypermedia from multimedia. Perhaps Wikipedia wasn’t such a bad source after all!</p>
<p>This leads us to the question of how to realize interactivity in a machine-to-machine context. In the presentation slides referenced above, Fielding notes:</p>
<blockquote><p>Hypertext does not need to be HTML on a browser – machines can follow links when they understand the data format and relationship types</p></blockquote>
<p>This evokes the notion of a spider crawling through linked documents, and it is certainly common to see attempts at building RESTful clients take an approach that is similar to spiders. However, in the context of HTML, spiders are form of “secondary client”. Unlike browsers they do not realize the controls described by the hypermedia document. HTML is a declarative format – it is a description of the interactive output of the browser. As described by the <a title="Axioms of Web Architecture" href="http://www.w3.org/DesignIssues/Principles.html#PLP">Principle of Least Power</a>, a secondary client like a spider can analyze what the browser would do when given a specific hypertext document as input without actually realizing the presentation of information and controls itself. If hypertext documents were instead written in an imperative language like Java, this would not be possible.</p>
<p>Because a spider is able to determine what effect the activation of a specific control (e.g. clicking a link) will take, it is able to perform the same action itself (e.g. GET the document referenced by the link URI). This is not the same thing as using the control as realized by the browser. The browser uses graphical means (usually blue, underlined text and a special mouse cursor) to indicate that a section of text is a link that can be clicked. The browser receives an input event to tell it when the section on the screen where the link resides has been clicked which triggers the associated action. The text itself provides additional details to the user regarding the meaning of the link, whereas the spider may use this text as well as other information, such as a link relation, that is hidden from the user.</p>
<p>A spider does not use the controls described by the hypertext document &#8212; even if it could realize the controls, they are designed to be used by human beings. Rather, it attempts to understand the meaning of the control based on the declarative description of what is conveyed to the user about that control as well as control metadata such as link relations. Based on this information it determines whether to take the action associated with the control. Because of this, spiders are typically limited in what they can do. For example, spiders usually cannot fill in and submit a form without some out-of-band knowledge about the web site (e.g. that the form is designed to capture the details of a book purchase).</p>
<p>To deal with this issue, machine-specific control information is often layered onto a user-specific HTML page. Link relations, microformats and the like are constructs for this purpose. Another approach is to use an entirely separate format from HTML for machine interaction with a service. Unfortunately, the controls offered to the client programs are quite anemic, modeled after the &lt;link&gt; tag in HTML with nothing but a simple link relation to drive the control. Interestingly, the &lt;link&gt; tag is not associated with a UI control in HTML; the de facto standard for machine-to-machine hypermedia controls isn’t a control at all. It is a declaration of a typed association between two resources – not the same thing. The &lt;a&gt; tag is a control, but &lt;link&gt; is not even though they are both types of &#8220;links&#8221;.</p>
<p>I suggest that a new approach to hypermedia design is required to address the needs of machine-to-machine systems; one that is based on the design of data-guided controls that are appropriate for the specific machine-driven clients that are relevant to a problem space. An approach that treats a machine control as an analogue of user interface controls: a construct that provides an equivalent to perceived affordance suitable for machines and processes input events from machines. I intend to explore this further in upcoming posts.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linkednotbound.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linkednotbound.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linkednotbound.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linkednotbound.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linkednotbound.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linkednotbound.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linkednotbound.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linkednotbound.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linkednotbound.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linkednotbound.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linkednotbound.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linkednotbound.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linkednotbound.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linkednotbound.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=57&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linkednotbound.net/2010/08/25/m2m-hypermedia/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbff68c4b9ecf3713dce0ef2e2e10856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aawahbe</media:title>
		</media:content>
	</item>
		<item>
		<title>Self-Descriptive Hypermedia</title>
		<link>http://linkednotbound.net/2010/07/19/self-descriptive-hypermedia/</link>
		<comments>http://linkednotbound.net/2010/07/19/self-descriptive-hypermedia/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 17:52:20 +0000</pubDate>
		<dc:creator>Andrew Wahbe</dc:creator>
				<category><![CDATA[Hypermedia]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://linkednotbound.net/?p=41</guid>
		<description><![CDATA[In my last post, I argued for designing RESTful hypermedia around the capabilities and needs of the client rather than around a specific service. A reasonable question to ask is whether the constraints of REST require this, or whether it is simply a good practice. This issue is definitely related to REST’s Uniform Interface constraint [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=41&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my <a title="Hypermedia is the Client's Lens" href="/2010/06/09/hypermedia-is-the-clients-lens/">last post</a>, I argued for designing RESTful hypermedia around the capabilities and needs of the client rather than around a specific service. A reasonable question to ask is whether the constraints of REST require this, or whether it is simply a good practice. This issue is definitely related to REST’s Uniform Interface constraint which requires that messages be self-descriptive. What isn’t always clear is what is meant by “self-descriptive” in the context of data formats. Roy Fielding <a title="rest-discuss" href="http://tech.groups.yahoo.com/group/rest-discuss/message/6594">explains on the REST-discuss list</a>:</p>
<blockquote><p>Self-descriptive means that the type is registered and the registry points to a specification and the specification explains how to process the data according to its intent. The specification does not need to be a standard (a.k.a., a measure that everyone agrees to). It would help, but most useful standards are defined through use. Whoever starts sending the data first should define the specification according to what is being sent, not try to get everyone to agree first.</p></blockquote>
<p>Roy <a title="rest-discuss" href="http://tech.groups.yahoo.com/group/rest-discuss/message/6613">later goes on to explain</a>:</p>
<blockquote><p>This is one of those gray areas of increasing RESTfulness that will doubtless drive some people nuts. The problem is that I can&#8217;t say &#8220;REST requires media types to be registered&#8221; because both Internet media types and the registry controlled by IANA are a specific architecture&#8217;s instance of the style &#8212; they could just as well be replaced by some other mechanism for metadata description.</p>
<p>The broader question is what does it take to create an *evolving* set of standard data types? Obviously, I can&#8217;t say that all data types have to be *the* standard before they are used in a REST-based architecture. At the same time, I do require enough standardization to allow the data format sent to be understood as such by the recipient. Hence, both sender and recipient agree to a common registration authority (the standard) for associating media types with data format descriptions. The degree to which the format chosen is a commonly accepted standard is less important than making sure that the sender and recipient agree to the same thing, and that&#8217;s all I meant by an evolving set of standard data types.</p></blockquote>
<p><span id="more-41"></span>And so standardization isn’t necessarily the deciding factor in self-descriptiveness. At the end of the day, the sender and receiver need to have agreement on the format being used for a representation (through the media type indicated in the transfer protocol) and have a well understood way to map that format name to a specification. This doesn’t seem to say much about the nature of the formats themselves though.</p>
<p>In the same posting, Roy identifies <a title="Data Elements" href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_2_1">section 5.2.1 of his dissertation</a> as the definition of the self-descriptiveness constraint (at least as it pertains to the data format). I find this section particularly useful because it compares the RESTful architecture of the Web to three alternative architectures for distributed hypermedia systems. Contrasting the Web with other possible solutions makes the distinguishing features of REST much more clear and highlights the strengths and weaknesses of the style.</p>
<p>The three alternatives proposed can be summarized as follows:</p>
<p>1)      <em>A client-server architecture where requested information is rendered on the server and the resulting image is sent to the client.</em> A key benefit of this architecture is the encapsulation of the server-side data. This decouples the client from the server, isolating it from implementation details and allowing the service to evolve independently from the client – new features could easily be added to a web site in this architecture, the image sent to the client would just change appropriately. This comes at the cost of scalability issues as the server must take on the processing associated with rendering images, as well as the bandwidth cost of transmitting each page as an image. Additionally, the client is restricted to being a browser – or at least something that can deal with page images. For example, it would be practically impossible to implement a spider in this architecture.</p>
<p>2)      <em>A mobile-object style architecture where the server sends a combination of both the data and a rendering engine (i.e. processing logic or code) to the client.</em> This provides data encapsulation within the downloaded rendering engine running on the client. The server also offloads some processing to the client at the cost of the increased bandwidth for downloading application code. Here the client is even further restricted in what it can do – little more than simply running the downloaded application code.</p>
<p>3)      <em>An architecture where the server sends the raw data to the client along with a media type that indicates the data format allowing the client to choose a rendering engine for the data.</em> This offloads the processing associated with rendering from the server and limits the bandwidth requirements as only the raw data is downloaded. The client is fairly unrestricted – it could be a browser, or a spider, or anything that is able to process the raw data. However, this comes at the cost of data encapsulation. The client is exposed to the server’s raw data, increasing coupling and limiting the server’s ability to evolve or change its implementation.</p>
<p>Option 3 addresses the shortcomings of Options 1 and 2 at the cost of data encapsulation. Also, while Option 3 allows for a wider range of clients, the processing that can be performed by any single client implementation in Option 3 is fixed. Option 2, through downloaded code, affords a single client more flexibility.</p>
<p>One might think that Option 3 is REST, but it isn’t – there are subtle differences. REST is described as follows:</p>
<blockquote><p>REST provides a hybrid of all three options by focusing on a shared understanding of data types with metadata, but limiting the scope of what is revealed to a standardized interface. REST components communicate by transferring a representation of a resource in a format matching one of an evolving set of standard data types, selected dynamically based on the capabilities or desires of the recipient and the nature of the resource. Whether the representation is in the same format as the raw source, or is derived from the source, remains hidden behind the interface. The benefits of the mobile object style are approximated by sending a representation that consists of instructions in the standard data format of an encapsulated rendering engine (e.g., Java).</p></blockquote>
<p>The first key distinction is that the <em>raw data</em> is not sent to the client in REST; instead, the data is converted into representation format that is:</p>
<p>a)      “Matching one of an evolving set of standard types” – this is elaborated in detail above.</p>
<p>b)      “Selected dynamically based on the capabilities or desires of the recipient and the nature of the resource” – this is essentially content negotiation. The format used to represent the data when transmitting it to the client isn’t fixed; an appropriate format can be selected for each request. Obviously different sets of formats are applicable to the various classes of resource (e.g. there are distinct formats that can be used for images and hypermedia). The client is able to constrain the set of formats it is willing to accept in the request (the HTTP accept header is designed for this, though separate URIs are often used in practice).</p>
<p>For example, rather than sending raw database query results to the client, you convert them into the standardized format most appropriate for the client before returning it. For a web browser, this is likely HTML, for a voice browser – VoiceXML. Of course, as Fielding points out, some resources are simply static hypermedia pages. Here, the raw data format is the same as the representation format, but should they be different, the client only ever sees (i.e. depends on) the representation format.</p>
<p>The second key distinction is that some of the standard data formats supported by a client can be bytecode or scripts – code on demand. This provides similar benefits as Option 2 as a single client is provided with increased flexibility. Of course, the more downloadable code is used, the more you are impacted by the drawbacks of Option 2. It is up to the architect to properly balance the tradeoffs for a specific system’s needs.</p>
<p>There is another set of tradeoffs to consider in the nature of the hypermedia format used – this gets us back to the subject of my previous post. As we have just seen, a RESTful service does not send its raw data to the client (that’s Option 3, not REST); it must be converted to a self-descriptive format. Given the data encapsulation benefits that this is intended to provide, it should be clear that simply serializing your raw data into XML or JSON doesn’t cut it. Angle brackets and curly braces don’t hide implementation details.</p>
<p>I would say that the minimum amount of abstraction is provided by a standardized format specific to an application, for example, a standard format for online book sellers. (I’m using <a title="rest-discuss" href="http://tech.groups.yahoo.com/group/rest-discuss/message/10256">Roy Fielding’s definition of application</a> which is basically “something the user wants to do with computers” such as buying a book. I’ve used “service” to denote a specific instance of an application.) If an interface can be exported by multiple distinct implementations it’s a sure sign that it’s not coupling the client to a specific one. Of course, such a format would limit the ability for a service to evolve as I described previously. For example, if the service changed to also support trading books or selling other types of goods, the application-specific format would likely not be sufficient for these new features.</p>
<p>Data encapsulation and service evolvability can be maximized by instead designing (or selecting) a format around the client’s needs. This is because such a format more closely matches the full space of applications that the client is able to support. If you want a single service to be accessible by two distinct clients that don’t use the same format(s) then simply support them both, using content negotiation or distinct URIs to allow a client to choose the right one.</p>
<p>This data encapsulation may come at the cost of some efficiency as compared to a format designed around the application. Also, it requires that the service designer, at implementation time, has some understanding of the clients that will use the service. It is up to the system designers to consider the tradeoffs and choose a format that meets their needs. But REST does not constrain you to using a broader, standard format – an application-specific format is RESTful as long as it meets the self-descriptiveness criteria described above. Roy Fielding touches on this in <a title="rest-discuss" href="http://tech.groups.yahoo.com/group/rest-discuss/message/6613">one of the postings already linked above</a>, saying:</p>
<blockquote><p>Sure, it is easier to deploy the use of a commonly understood data format. However, it is also more efficient to use a format that is more specifically intended for a given application. Where those two trade-offs intersect is often dependent on the application. REST does not demand that everyone agree on a single format for the exchange of data &#8212; only that the participants in the communication agree. Beyond that, designers need to apply their own common sense and choose/create the best formats for the job.</p>
<p>If we want to call one more RESTful than the other, then we have to take the goal of evolution into account. I would say it is more RESTful to use a specific standard type when applicable or to define a new type that is specific to a given purpose AND intended to be standardized for that application type (i.e., proprietary types are less RESTful than industry-wide standard types, but new standard types are not less RESTful than old standard types). But that is really only my personal preference, since the style does not constrain REST-based architectures to a single standard.</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linkednotbound.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linkednotbound.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linkednotbound.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linkednotbound.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linkednotbound.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linkednotbound.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linkednotbound.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linkednotbound.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linkednotbound.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linkednotbound.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linkednotbound.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linkednotbound.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linkednotbound.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linkednotbound.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=41&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linkednotbound.net/2010/07/19/self-descriptive-hypermedia/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbff68c4b9ecf3713dce0ef2e2e10856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aawahbe</media:title>
		</media:content>
	</item>
		<item>
		<title>Hypermedia is the Client&#8217;s Lens</title>
		<link>http://linkednotbound.net/2010/06/09/hypermedia-is-the-clients-lens/</link>
		<comments>http://linkednotbound.net/2010/06/09/hypermedia-is-the-clients-lens/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 18:43:00 +0000</pubDate>
		<dc:creator>Andrew Wahbe</dc:creator>
				<category><![CDATA[Hypermedia]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://linkednotbound.net/?p=32</guid>
		<description><![CDATA[RESTful systems are by definition supposed to be based on the architectural style of the Web; however, there is one big fat glaring difference between the Web and almost all of the other systems out there that claim to be RESTful. I&#8217;m not talking about use of methods or any other aspect of HTTP. I&#8217;m [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=32&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>RESTful systems are by definition supposed to be based on the architectural style of the Web; however, there is one big fat glaring difference between the Web and almost all of the other systems out there that claim to be RESTful. I&#8217;m not talking about use of methods or any other aspect of HTTP. I&#8217;m not talking about the structure of the URIs, the resources in the system, or even whether or not the representations contain links. Many systems that can honestly claim to be at Level 3 of the <a id="nfy4" title="MartinFowler.com: The Richardson Maturity Model" href="http://martinfowler.com/articles/richardsonMaturityModel.html">Richardson Maturity Model</a> have this deficiency.</p>
<p>I&#8217;m talking about over-constrained, service-specific hypermedia formats that precisely represent a service&#8217;s resources and workflow. It&#8217;s hard to think of this as a &#8220;problem&#8221; &#8212; it&#8217;s what we&#8217;re used to doing in software interfaces. But this is certainly not how things work on the Web. Here we have a single format, HTML, used by a wide variety of services: Google, Facebook, Amazon, etc., that all do very different things. The markup language is not designed around the semantics of any of the resources exposed by these services. There is no &lt;book&gt; element used to represent a book on Amazon.com. The Web&#8217;s interface is uniform not only because of HTTP but also because of HTML.</p>
<p><span id="more-32"></span>Think of it this way: the fact that HTML is able to describe a wide variety of services not only allows a single client to work with the limitless set of sites on the Web, but also allows a single service to evolve. A site can change itself from one of the services describable by HTML to another without requiring the browser to be updated. However, if a hypermedia format is only able to express a very constrained range of services, then service evolution becomes impossible. If you provide a service for &#8220;sprocket management&#8221; and your hypermedia format is defined in terms of sprockets, collections of sprockets and link relations describing all the supported actions one might take on sprockets, then it&#8217;s hard to see how it could be used for anything else in the future.</p>
<p>You may be wondering how exactly you go about broadening the range of your service&#8217;s hypermedia format. Sure you can generalize the format (maybe a sprocket is just a type of widget and instead of sprocket collections, you can just have a generic collection element) but that will only get you so far. And more importantly, most folks don&#8217;t have the precognitive abilities required to know where their service is going to evolve to in the future. Format extensibility isn&#8217;t the answer either: clients would still need to be adapted to any extensions required to support changes to a service.</p>
<p>We can look to the Web for a strategy to deal with this.</p>
<p>The formats used on the Web aren&#8217;t designed around the services. They are designed around the client and what it does with the information. A browser is a program that presents information to human beings, primarily through a textual/graphical user interface, and the browser languages revolve around the needs of this task. HTML tags are used to provide structure to text and inline media as well as provide controls for interacting with the information via links and forms. CSS allows the presentation to be customized, and Javascript event handlers express handling for focus, mouse click, and other events if the default handlers aren&#8217;t appropriate for the application. These languages drive what the browser does with the information &#8212; they have nothing to do with the specific services being executed.</p>
<p>HTML is the language of the browser; it is the lens through which browsers see all resources. Services adapt their information and workflow descriptions (resources) into documents in this language (representations) when working with browsers. The HTTP Accept header tells them that they are working with a client that speaks the browser&#8217;s language &#8212; a browser or some other client, like an indexing spider that would like to see the resources from the browser&#8217;s perspective.</p>
<p>When building RESTful systems for other domains, why do we make the hypermedia format specific to the service? Instead, we should be defining hypermedia formats around the clients &#8212; if the goal is to allow the client to interact with the widest range of services possible, then it makes sense to use a format that is designed around the client semantics and bounded only by the capabilities of the client.</p>
<p>At first glance this seems to be binding the service to a specific client &#8212; but not completely due to the declarative nature of markup and the <a id="ttm5" title="Axioms of Web Architecture: Principle of Least Power" href="http://www.w3.org/DesignIssues/Principles.html#PLP">Principle of Least Power</a>. Other, secondary types of clients like indexing spiders are able to analyse the markup and understand what it does to provide other capabilities such as search. So really the service is bound to the ecosystem of clients that understand that markup language. But still, this model does limit the clients that can be supported with a single markup language.</p>
<p>This is where the separation of resources and representations, and <a id="fnz_" title="Content Negotiation: why it is useful, and how to make it work" href="http://www.w3.org/QA/2006/02/content_negotiation.html">Content Negotiation</a> (conneg) come into play. A single resource can have multiple representations. They can have a separate URIs or share a single one (using the conneg features of HTTP), but either way a client is able to get the resources represented in a format it supports. By supporting multiple hypermedia formats, your service can cater to multiple classes of client simultaneously. Support for new formats/clients can easily be added without disrupting existing ones.</p>
<p>For example, say that you are building services within a bank. Rather than designing a single hypermedia format around the resources and services such as accounts, balances and financial transactions, design (or re-use) separate formats for each type of client. The teller terminals would likely use HTML, the ATM machine might also use HTML or something similar to deal with the specifics of the interface, a hypermedia format might be designed for automated cheque processing machines. Inter-bank transactions are a tricky point &#8212; this might require a format designed around accounts, transactions etc. but this should be at least customized to the specific inter-bank use cases. However, an alternative approach might be to support multiple hypermedia formats at the inter-bank boundary for the specific client types. (Ok, so I&#8217;m not in banking myself, so maybe I&#8217;m a little off base here on the specifics but I think the principle is sound. If you want examples from my domain, I can simply refer you to <a id="ztpl" title="Voice eXtensible Markup Language 2.0" href="http://www.w3.org/TR/voicexml20/">VoiceXML</a> and <a id="e30y" title="Call Control eXtensible Markup Language" href="http://www.w3.org/TR/ccxml/">CCXML</a>.) By customizing the hypermedia to the capabilities and needs of the individual classes of client, you provide the services with the ability to change and grow.</p>
<p>This model is based on the assumptions that the services outnumber and will evolve more quickly than the clients and that updating clients is more difficult/expensive than updating services. HTML and browsers do evolve &#8212; but there are far fewer browser implementations and versions of HTML than there are services (never mind versions of those services). Also, it is much more difficult to get millions of users to update their browsers than to update your web site. If these assumptions don&#8217;t hold for your domain, maybe designing your hypermedia format around your service does make sense &#8212; just don&#8217;t fool yourself into thinking that you&#8217;ve decoupled your clients from your services.</p>
<p>That&#8217;s enough for now. I&#8217;ve likely raised more questions than I&#8217;ve answered here but this is definitely not my last word on this. I plan to provide more details in upcoming posts. Please fire away with the questions and feedback though so I can focus on the right areas.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linkednotbound.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linkednotbound.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linkednotbound.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linkednotbound.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linkednotbound.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linkednotbound.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linkednotbound.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linkednotbound.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linkednotbound.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linkednotbound.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linkednotbound.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linkednotbound.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linkednotbound.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linkednotbound.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=32&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linkednotbound.net/2010/06/09/hypermedia-is-the-clients-lens/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbff68c4b9ecf3713dce0ef2e2e10856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aawahbe</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction</title>
		<link>http://linkednotbound.net/2010/05/17/introduction/</link>
		<comments>http://linkednotbound.net/2010/05/17/introduction/#comments</comments>
		<pubDate>Mon, 17 May 2010 04:32:43 +0000</pubDate>
		<dc:creator>Andrew Wahbe</dc:creator>
				<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[SIP]]></category>
		<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[Voice]]></category>

		<guid isPermaLink="false">http://linkednotbound.net/?p=24</guid>
		<description><![CDATA[I&#8217;ve been standing silently at the edge of the ongoing party that is the tech blogosphere for quite a while, just listening to the discussion. Slowly, I&#8217;ve joined in the conversation, first in blog comments, forums and mailing lists, and more recently in Twitter. But it&#8217;s awfully hard to really communicate without a blog of your own, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=24&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>I&#8217;ve been standing silently at the edge of the ongoing party that is the tech blogosphere for quite a while, just listening to the discussion. Slowly, I&#8217;ve joined in the conversation, first in blog comments, forums and mailing lists, and more recently in <a id="xz-g" title="Twitter" href="http://twitter.com/AndrewWahbe">Twitter</a>. But it&#8217;s awfully hard to really <em>communicate</em> without a blog of your own, and I&#8217;ve finally decided it&#8217;s time for me to take the floor.</div>
<p>I&#8217;m certain that most of what I have to say here will be related to software architecture. It&#8217;s what I spend my days working on, and while you&#8217;d think that it would be the last thing I&#8217;d want to spend my nights writing about, it&#8217;s a topic on which I have a lot of opinions and insights to share. While I&#8217;ve had a variety of roles in my career, I&#8217;ve been largely focused on loosely-coupled, hyperlink-driven systems based on standard protocols and formats &#8212; in a nutshell: Web-inspired software architecture. I imagine that this will be the prominent theme here (though I don&#8217;t have long term plans for what I am going to cover beyond the first few posts). The title of this blog, &#8220;<em>linked, not bound</em>”, is meant to reflect the nature of the subject matter, though it incidentally describes the format as well.</p>
<p><span id="more-24"></span>Blogs are a very personal form of communication. Because the writing reflects the views of the author it often tells you as much about them as it does about the subject matter. I think that this, my first post, should elaborate on not only the subject of this blog but also my relationship to the topic. When I used the term <em>Web-inspired software architecture</em> above, I was not refering to the architecture of the Web itself &#8212; the world of HTML and desktop browsers, but to the Web&#8217;s architectural style. Unless you&#8217;ve been hiding under a digital rock, you&#8217;ll know that I&#8217;m referring to Representational State Transfer or <a id="hu.b" title="REST" href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm">REST</a>.</p>
<p>And so at this point, I need to do a little work to keep your attention. Most folks these days are desperately trying to reduce their data intake by unfollowing or unsubscribing from low-value information sources. We&#8217;ve all got busy lives and if a blog doesn&#8217;t offer something new and unique then it&#8217;s not worth the reader&#8217;s (nor the writer&#8217;s) time. REST certainly isn&#8217;t new; in fact it&#8217;s probably in the waning stages of the hype cycle by now. But that&#8217;s the problem: the subject has not just been beaten to death, it&#8217;s been beaten beyond recognition. A lot of the content covering REST really misses the mark or is just plain wrong &#8212; a problem that snowballs as folks learn from this misinformation and then spread it in their own blogs, or worse, crank out half-baked APIs and mislabel them as RESTful.</p>
<div>
<p>Not all of the content is bad though; there are a lot of smart people out there that do understand REST pretty well and are writing great material on the topic. But even those that have a good grasp of the theory often have a hard time applying it to their own systems. A lot of the advice available to implementers of RESTful systems is about what they shouldn&#8217;t do: don&#8217;t use <a id="vot4" title="Web Services Description Language" href="http://www.w3.org/TR/wsdl">WSDL</a> or <a id="an8d" title="Web Application Description Language" href="http://www.w3.org/Submission/wadl/">WADL</a>, don&#8217;t put verbs in URIs, don&#8217;t define the API in terms of a server-side object model, don&#8217;t use POST when another method is a better fit, and so on. But the guidelines for what you <em>should</em> do often amount to: use HTTP correctly and define your interface in terms of a hypermedia language. While learning HTTP is relatively straight forward if you&#8217;re willing to spend the time, designing a hypermedia format can be challenging &#8212; especially if you haven&#8217;t been exposed to a wide variety of markup languages. Also, as very few developers have worked on any sort of hypermedia browser, they are often completely lost when it comes to writing a RESTful client.</p>
<p>I think that, because of my background, I have some insights and advice to share on these topics that others might find both interesting and useful &#8212; that&#8217;s why I&#8217;m writing this blog. I first began practicing REST-based software design almost 10 years ago &#8212; before I knew what REST was. Back then I was working on what is known as a &#8220;<a id="fmha" title="Wikipedia: Voice Browser" href="http://en.wikipedia.org/wiki/Voice_browser">Voice Browser</a>”. If you&#8217;ve called a 1-800 number in the past few years and reached an automated voice system then you&#8217;ve likely used a voice browser. These days these systems are primarily driven by a markup language called <a id="xdqf" title="VoiceXML 2.0" href="http://www.w3.org/TR/voicexml20/">VoiceXML</a> that defines the interface. When the system takes a call, the dialed number is translated into an HTTP URI that is used to fetch an initial VoiceXML page that tells the system what audio prompts to play back to the user. It also tells the voice browser how to fetch the subsequent page based on the user&#8217;s voice or touch-tone input. If this sounds a bit like an HTML browser but for voice interfaces then you&#8217;ve got the idea.</p>
<p>I first heard about REST back in 2002. When Google released their SOAP API, it came under fire from a lot of the early REST proponents and the resulting argument made its way into tech <a id="wbvt" title="InfoWorld: hyperlinks matter" href="http://www.infoworld.com/d/architecture/hyperlinks-matter-961">news</a> and <a id="gjly" title="O'Reilly XML Blog: Google's Genius" href="http://www.oreillynet.com/xml/blog/2002/04/googles_genius.html">blogs</a> (looking back, it&#8217;s strange to see Sam Ruby on the SOAP side of the fence). It initially got my attention because I knew and respected a couple of its strongest advocates. <a id="rhvf" title="Paul Prescod" href="http://www.prescod.net/">Paul Prescod</a> was in my class at the University of Waterloo; I didn&#8217;t really know him personally but I knew he was a smart guy. Also while at UW, I interned at a company called Teleride Sage where I was fortunate to have <a id="qsy1" title="Mark Baker" href="http://www.markbaker.ca/blog/about/">Mark Baker</a> as my manager. Even though I only worked for him briefly, I remember learning a lot from him. I also recall him being pretty excited about this cool, new &#8220;Mosaic&#8221; program that he thought everyone should check out. So when these guys began screaming that the entire tech industry was heading in the wrong direction with SOAP, I was very curious to see what they were on about.</p>
<p>As I read more about REST, it resonated with me because I could relate it to the work I was doing in Voice Browsers. For example, I&#8217;d had debates with co-workers who were pushing to replace simple GET requests with SOAP where I&#8217;d argue that &#8220;it&#8217;s supposed to work like a web browser!&#8221; REST finally put a name to the concept of a system that works like the web. It provided a framework to help guide design work and got me interested in the foundations of software architecture &#8212; another topic that I plan to write about.</p>
<div>
<p>I spent a number of years working with VoiceXML from all different angles, building browsers, applications and tools. This included working on a system based on VoiceXML&#8217;s sister language: <a id="sn_q" title="Call Control XML" href="http://www.w3.org/TR/ccxml/">CCXML</a>. I frequently refer folks to CCXML as it is a language that is worthy of attention. Many REST practitioners struggle in trying to apply the style in contexts where the client is not directed by a human being through a user interface. CCXML is a standard hypermedia format that provides similar client-server decoupling as HTML and VoiceXML but unlike those languages, does not drive a UI. I intend to spend quite a bit of time here discussing CCXML and what can be learned from it.</p>
<p>A few years ago, I switched gears to work at a company that <a id="lvqw" title="NeoEdge Networks" href="http://www.neoedge.com/">put ads in casual games</a> and was able to apply RESTful principles in an entirely different domain before moving back to the <a id="tuls" title="Alcatel Lucent" href="http://www.alcatel-lucent.com/">telecommunications space</a>. I only spend a small fraction of my time working on RESTful systems these days &#8212; my core focus is now on <a id="i8vf" title="Session Initiation Protocol" href="http://tools.ietf.org/html//rfc3261">SIP</a> communications platforms. This provides yet another <a id="ibqo" title="Architecture and Design Principles of SIP" href="http://tools.ietf.org/id/draft-rosenberg-sipping-sip-arch-01.txt">link-driven architectural style</a> to study and discuss here. I will definitely try and make it relevant for webby folks and do my best to help them appreciate SIP &#8212; it is certainly in their HTTP comfort zone.</p>
<p>I think my experience, while not entirely unique (there are quite a few <a id="a9ur" title="W3C Voice Browser Working Group: Implementations" href="http://www.w3.org/Voice/#implementations">VoiceXML &amp; CCXML platforms</a> out there), is a little off the beaten path for most web-centric folks. I&#8217;ve found that I often have a slightly different take on things than folks who&#8217;ve only dealt with HTML, Atom and the Semantic Web. I hope that this forum allows me to provide you with content that is both interesting and valuable, and generate some good conversations as well.</p>
</div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/linkednotbound.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/linkednotbound.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/linkednotbound.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/linkednotbound.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/linkednotbound.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/linkednotbound.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/linkednotbound.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/linkednotbound.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/linkednotbound.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/linkednotbound.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/linkednotbound.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/linkednotbound.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/linkednotbound.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/linkednotbound.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=linkednotbound.net&amp;blog=12006924&amp;post=24&amp;subd=linkednotbound&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://linkednotbound.net/2010/05/17/introduction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbff68c4b9ecf3713dce0ef2e2e10856?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aawahbe</media:title>
		</media:content>
	</item>
	</channel>
</rss>
