<?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/"
	>

<channel>
	<title>brettdargan.com &#187; Web</title>
	<atom:link href="http://brettdargan.com/blog/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://brettdargan.com/blog</link>
	<description>&#955; Thoughts and rants</description>
	<lastBuildDate>Fri, 28 May 2010 01:35:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>JAOO 2009 &#8211; Brisbane</title>
		<link>http://brettdargan.com/blog/2009/05/19/jaoo-2009-brisbane/</link>
		<comments>http://brettdargan.com/blog/2009/05/19/jaoo-2009-brisbane/#comments</comments>
		<pubDate>Mon, 18 May 2009 14:12:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Stability, Performance and Monitoring]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=380</guid>
		<description><![CDATA[Another good event, great speakers, lots of language talks, agile, architecture, scalability, databases ala megastore. highlights for me, in no particular order. Avi Bryant's new project, great eye candy had the crowd go &#34;ooooooooohhh&#34;. When will an api be open to plug other data in??? Also nice talk on VM history, how we are working [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>Another good event, great speakers, lots of language talks, agile, architecture, scalability, databases ala megastore.
highlights for me, in no particular order.</p>
<ul>
<li><dl class="first docutils">
<dt><a class="reference external" href="http://jaoo.com.au/brisbane-2009/speaker/Avi+Bryant">Avi Bryant's</a> new project, great eye candy had the crowd go &quot;ooooooooohhh&quot;.  When will an api be open to plug other data in???</dt>
<dd><ul class="first last simple">
<li>Also nice talk on VM history, how we are working on VMs from algo's designed in the 80's. And the features or standard of VMs aren't available for all our favourite languages.</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><a class="reference external" href="http://jaoo.com.au/brisbane-2009/speaker/Jon+Tirsen">Tiersen</a> , good intro to sharding and google approach to scaling out</dt>
<dd><ul class="first last simple">
<li>liked the probability graphs</li>
<li>read chubby, logserve paper</li>
<li>higher level of jonas discussion, but jonas did refer to tiersen counter example</li>
<li>When the web came along, our apps were read mostly.</li>
<li>These days, social sites, are moving away from this scheme, to one of shared data. Some of that shared data is written to a lot. but it is updated, the majority of it is always inserts only.</li>
<li>write fan outs.</li>
<li>combine the two operations in one, so write + read all counters at same time</li>
<li>counter example too simple, can bypass optimistic locking as counter should be monotonically increasing</li>
<li>combine websites with fragments of data/entities with different shards and shard policies.</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><a class="reference external" href="http://jaoo.com.au/brisbane-2009/speaker/Jonas+S+Karlsson">Jonas</a> - great talk re Megastore</dt>
<dd><ul class="first last simple">
<li>Treat everything as an insert, duplicates will occur make sure they are idempotent</li>
<li>Updates are a little harder, but what is an update really, when can you say it is actually done?</li>
<li>Confirmed for me that a current strategy i'm implementing is right and will work (well for two, maybe three nodes anyway).</li>
<li>To get to more will need a decent <a class="reference external" href="http://en.wikipedia.org/wiki/Paxos_algorithm">Paxos implementation</a>, which takes smart ppl and time.</li>
<li>consistency, availability, entity groups and big table</li>
<li>web apps more read/write than before, lots of shared data, but mostly additions</li>
<li>consistency, reliability, storage, scalability and megastore scale, entity groups, transactionality, avoiding joins</li>
<li>consistency: user trust, none, eventual, entity group, global</li>
<li><strong>consistency: &quot;a harmonious uniformity of agreement among things or parts&quot;</strong></li>
<li>Sharding by entity groups.</li>
<li>storage vs. cost of loss</li>
<li>paxos vs. 2pc</li>
<li>papers jonas recommended: pat helland paper; jinquan dai, intel, james hamilton, MS</li>
<li>I have a lot more to say about this topic, as I cut my teeth on Oracle Performance Tuning and it's architecture, always providing a READ CONSISTENT transaction at a minimum, I use to think was a great idea, until I wanted to scale it further.</li>
<li>Disk Reads are about 10,000 slower than memory access, but not if you have to manage a lot of versions of different blocks in memroy. The overheads reduce the read in memory to <strong>ONLY 10 to 100 times faster than a disk read</strong>. That just isn't enough. See <a class="reference external" href="http://www.hotsos.com/e-library/abstract.php?id=7">Milsap papers on Oracle scaling</a>  there are a number of them and <a class="reference external" href="http://www.scaleabilities.co.uk/book/scalingOracle8i.pdf">James Morle's book on Scaling Oracle 8i which is a great book, the older print version can still be picked up as well</a></li>
<li>The approach of one single db instance creates new problems, now we need transaction logs and a hot standby and a DR data centre...</li>
</ul>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><a class="reference external" href="http://jaoo.com.au/brisbane-2009/speaker/Michael+T.+Nygard">Nygard</a> (<a class="reference external" href="http://www.amazon.com/Release-Production-Ready-Software-Pragmatic-Programmers/dp/0978739213/ref=sr_1_1?ie=UTF8&amp;#038;s=books&amp;#038;qid=1242652387&amp;#038;sr=1-1">Release It!</a> )- i missed the first one due to a conflict &lt;img src='<a class="reference external" href="http://brettdargan.com/blog/wp-includes/images/smilies/icon_sad.gif">http://brettdargan.com/blog/wp-includes/images/smilies/icon_sad.gif</a>' alt=':(' class='wp-smiley' /&gt; .</dt>
<dd><ul class="first last simple">
<li>Great stuff from what i hear, I've been pushing for some time implementation of his patterns.</li>
<li>motivated a number of devs at my company. Hopefully I'll see some badly behaving webservices and stability pattern implementations.</li>
<li>Here is a <a class="reference external" href="http://brettdargan.com/blog/2007/12/15/experimental-circuit-breaker-pattern-implementation/">simple Java Circuit Breaker Pattern Implementation from a ways back</a>.</li>
</ul>
</dd>
</dl>
</li>
<li><p class="first">mike cannon-brookes - had to fill a tough set of constraints, but interesting story about atlassian.</p>
</li>
<li><dl class="first docutils">
<dt><a class="reference external" href="http://jaoo.com.au/brisbane-2009/speaker/Clemens+Szyperski">Clemens</a></dt>
<dd><ul class="first last simple">
<li>ms unified component thingy. simliar to osgi. Nice talk about issues with design,  component composition and how all of IT boils down to composition of things at varying levels.</li>
<li>Discussion about component composition and how <strong>state is always a problem</strong>, yes.</li>
<li>Advocate of service use, <strong>not reuse</strong> as it should be used <strong>&quot;as is&quot;</strong></li>
<li>I prefer service use over code/component, especially with a services developed with RESTful intentions</li>
</ul>
</dd>
</dl>
</li>
<li><p class="first"><a class="reference external" href="http://dannorth.net">Dan North</a>, telling project war stories based on experience and
* observations of good architects
* soa gone bad, wsdl</p>
<ul class="simple">
<li>Listen, Listen, Listen</li>
<li>technical problems aren't the biggest issue, silo communication</li>
<li>replacement of tools sqlserver to oracle, not solving the real problem</li>
<li>the nameless quality</li>
<li>vision, inspiration, enabler</li>
<li>project shaman</li>
<li>empathise</li>
<li>self belief, a sense of conviction and humility</li>
</ul>
</li>
<li><dl class="first docutils">
<dt>Joshua Bloch - great stuff</dt>
<dd><ul class="first last simple">
<li>checkout <a class="reference external" href="http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/MapMaker.html">MapMaker</a></li>
</ul>
</dd>
</dl>
</li>
<li><p class="first">Eastman - apache mahut. Dirichlet clustering, hmm, that algorithm wasn't in <a class="reference external" href="http://www.amazon.com/Programming-Collective-Intelligence-Building-Applications/dp/0596529325/ref=sr_1_1?ie=UTF8&amp;#038;s=books&amp;#038;qid=1242654567&amp;#038;sr=1-1">Collective Intelligence</a></p>
</li>
<li><dl class="first docutils">
<dt>Douglas Crockford</dt>
<dd><ul class="first last simple">
<li>javascript inspired by self, scheme, perl and java</li>
<li>prefer === over == doesn't do type coercion</li>
<li>he no longer uses ++ and -- anymore, implicated in buffer overflow exploits</li>
<li>lambda, dyn objs, loose typing and object literals.</li>
<li>refreshing to discuss languages and language features again</li>
<li>the <a class="reference external" href="http://www.nczonline.net/blog/2009/01/27/speed-up-your-javascript-part-3/">memoizer example was good</a>, check the slides for recursion usage</li>
<li>use functions to make objects</li>
<li>functional inheritance</li>
<li>be rigorous and  use jslint</li>
</ul>
</dd>
</dl>
</li>
</ul>
<div class="section" id="other-comments">
<h3>Other Comments;</h3>
<blockquote>
<ul class="simple">
<li>Lots of cloud talks, <strong>very fluffy</strong>, but where was the discussion about <a class="reference external" href="http://kenai.com/projects/suncloudapis/pages/Home">SUN Cloud RESTful API</a></li>
<li>No REST, no erlang.</li>
</ul>
</blockquote>
</div>
<div class="section" id="books-to-checkout">
<h3>Books to checkout:</h3>
<blockquote>
<ul class="simple">
<li>Douglas Crockford, recommends <a class="reference external" href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/ref=sr_1_1?ie=UTF8&amp;#038;s=books&amp;#038;qid=1242693117&amp;#038;sr=8-1">JavascriptTheGoodParts</a></li>
<li>Steve Hayes, recommends <a class="reference external" href="http://www.amazon.com/Brain-Rules-Principles-Surviving-Thriving/dp/0979777747/ref=sr_1_1?ie=UTF8&amp;#038;s=books&amp;#038;qid=1242652608&amp;#038;sr=1-1">BrainRules</a></li>
<li>Linda Rising, recommends <a class="reference external" href="http://www.amazon.com/Strangers-Ourselves-Discovering-Adaptive-Unconscious/dp/0674013824/ref=sr_1_1?ie=UTF8&amp;#038;s=books&amp;#038;qid=1242652693&amp;#038;sr=1-1">StrangersToOurselves</a> by Timothy Wilson</li>
<li>Dan North, recommends <a class="reference external" href="http://www.amazon.com/Timeless-Way-Building-Christopher-Alexander/dp/0195024028/ref=sr_1_1?ie=UTF8&amp;#038;s=books&amp;#038;qid=1242652771&amp;#038;sr=1-1">TimelessWayOfBuilding</a>, yah, i have flicked through it, may borrow from a library or amazon, cause i haven't seen it in oz on a shelf for less than $140.</li>
</ul>
</blockquote>
</div>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=JAOO+2009+%E2%80%93+Brisbane+http%3A%2F%2Ftinyurl.com%2F5r8whbo" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=JAOO+2009+%E2%80%93+Brisbane+http%3A%2F%2Ftinyurl.com%2F5r8whbo" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/05/19/jaoo-2009-brisbane/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RIMVR and HATEOAS: MVC+URITemplateAspects, LinkAwareModels and LinkTemplateProcessors</title>
		<link>http://brettdargan.com/blog/2009/04/29/rimvr/</link>
		<comments>http://brettdargan.com/blog/2009/04/29/rimvr/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 12:24:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[RESTful]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=337</guid>
		<description><![CDATA[There has been a discussion titled [Jersey] Putting the RESTful "connectedness" around my existing Domain objects on the jersey mailing list that is starting up again. I don't think I have confused HATEOAS with "connectedness", I have a reasonable understanding of resource state, application state and HATEOAS. See http://www.stucharlton.com/blog/archives/000141.html and this discussion, http://tech.dir.groups.yahoo.com/group/rest-discuss/message/12497, which I [...]]]></description>
			<content:encoded><![CDATA[<p>There has been a discussion titled <a href="https://jersey.dev.java.net/servlets/ReadMsg?list=users&#038;msgNo=5657">[Jersey] Putting the RESTful "connectedness" around my existing Domain objects</a> on the jersey mailing list that is starting up again.</p>
<p>I don't think I have confused HATEOAS with "connectedness", I have a reasonable understanding of resource state, application state and HATEOAS.</p>
<p>See <a href="http://www.stucharlton.com/blog/archives/000141.html">http://www.stucharlton.com/blog/archives/000141.html</a> and this discussion, <a href="http://tech.dir.groups.yahoo.com/group/rest-discuss/message/12497">http://tech.dir.groups.yahoo.com/group/rest-discuss/message/12497</a>, which I see you have contributed to.</p>
<p>I think this final point made by <a href="http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven">Roy</a> is pretty applicable here:</p>
<blockquote><p>
A REST API should be entered with no prior knowledge beyond the initial URI (bookmark) and set of standardized media types that are appropriate for the intended audience (i.e., expected to be understood by any client that might use the API). From that point on, <b>all application state transitions must be driven by client selection of server-provided choices that are present in the received representations or implied by the user’s manipulation of those representations</b>. The transitions may be determined (or limited by) the client’s knowledge of media types and resource communication mechanisms, both of which may be improved on-the-fly (e.g., code-on-demand). [Failure here implies that out-of-band information is driving interaction instead of hypertext.]
</p></blockquote>
<p><b>My point is you can't adhere to the HATEOAS constraint, without providing links between resources</b> so the server can guide the client to other application states.</p>
<p>I agree that forms are a better example for explaining state transitions, especially since resource state is likely to be changed by providing forms (as will the User Agent, as Roy mentions); or equivalent form templates/prototypes for other media types.<br />
But to me providing forms or equivalents for other media types is a different and easier problem to solve.</p>
<p>I'm very interested in <b>how to evolve existing systems</b>; I want to leverage the <b>vast islands of information</b> that already exist. </p>
<p>I just want to do it in an elegant way from a <b>code</b> and a <b>web perspective</b>, including the fact that uri's shouldn't change.<br />
<div id="attachment_338" class="wp-caption alignleft" style="width: 310px"><a href="http://brettdargan.com/blog/wp-content/uploads/2009/04/hateoas_4_legacy.jpg"><img src="http://brettdargan.com/blog/wp-content/uploads/2009/04/hateoas_4_legacy-300x225.jpg" alt="RIMVR: MVC + URITemplateAspects; LinkAwareModels and LinkTemplateProcessor" title="hateoas_4_legacy" width="300" height="225" class="size-medium wp-image-338" /></a><p class="wp-caption-text">URITemplateAspects; LinkAwareModels and LinkTemplateProcessor</p></div></p>
<p>In a standard, layered design, you would have these components (see <a href="http://brettdargan.com/blog/wp-content/uploads/2009/04/hateoas_4_legacy-300x225.jpg">Image</a>):</p>
<p>1. Code-On-Demand<br />
2. View<br />
3. Controller<br />
4-6. Contains the Proposed Abstractions<br />
7. Model<br />
8. Persistent Store - Db; file; jcr; webdav<br />
9. Proxies</p>
<p>Here are some options I have for adding links around some existing system (there are likely more)</p>
<p>Due to the time constraints, the Pros, will be sparse.</p>
<h3>Option 1: Add Links via Code-On-Demand.</h3>
<p>Add links to my html page via javascript.<br />
I could take my existing html representation and use dhtml to add links.</p>
<p>Cons:<br />
* code-on-demand not available for all user agents or may be disabled<br />
* Proxies can't cache the entire representation<br />
* leak of possible application states to clients that don't need to know<br />
* Detailed knowledge of resource and subresources required to provide "link rich" representations<br />
* Alternative media types may require alternative languages or structure to perform add the links. ie. use of xsl for xml; javascript with svg.</p>
<h3>Option 2: Add Links via Views</h3>
<p>Cons:<br />
* We all know this is bad<br />
* Detailed knowledge of resource and subresources required to provide "link rich" representations<br />
* different views/media types require the same logic and detailed knowledge of the model<br />
* different views/media types may require some application state knowledge. an admin user may have other links than anon.</p>
<h3>Option 3: Add Links via Controllers</h3>
<p>Pros:<br />
* Can handle the inclusion/exclusion of links depending on the current application state, regardless of the media type to respond with </p>
<p>Cons:<br />
* Detailed knowledge of resource and subresources required to provide "link rich" representations</p>
<h3>Option 4: Add Links via Models</h3>
<p>Pros:<br />
* Detailed knowledge of the model and related models belong in the Model</p>
<p>Cons:<br />
* Detailed knowledge of resource links aren't the domain of the models<br />
* Not all possible related models are likely to be represented; to balance performance with types of usage, often some relationships are not modelled, so as to not eager load, very large graphs etc.<br />
* Links are very static, The "next available" application state, still needs to be determined in another layer, like Controller</p>
<h3>Option 5: Add Links via Persistent Store</h3>
<p>Store partial links in the db </p>
<p>Pros:<br />
* Db driven, easy to update<br />
* Tables have relationships<br />
* easy adoption path<br />
* easy to link to external resources, or resources outside your db schema<br />
* easy to share links at db level, if several systems integrate at that level<br />
* Good for sparse relationships. </p>
<p>Cons:<br />
* Update to change a link, will not play nice with intermediaries nor "cool uris, that don't change"<br />
* Not great for <b>consistent dense relationships</b>, you probably want to model that differently. So with a Parent Child relationship, you wouldn't want something in addition to existing foreign key relations, to redundantly specify that to get to the children of a parent you have a list of /child/xyz links. but by having that specified in the URITemplateAspect then you are managing that once, close to the data.<br />
* Relationships are not always defined in Foreign Keys<br />
* Links are very static, The "next available" application state, still needs to be determined in another layer, like Controller<br />
* Only a partial solution for more dynamic aspect of determining what application states make sense, still needs to be done in another layer.<br />
* May be invasive, links stored in columns or other tables, no good if you've got a locked down schema.</p>
<h3>Thoughts</h3>
<p>Models shouldn't have relationships to hardcoded resources, like "/resource/50", but they could have a semantic relationship to "/resource/{id}" or "/resource/{id};role={role}" under certain conditions.</p>
<p>There is a place for such LinkAwareModels (Component no. 5), as long as the links are isolated and only contain semantic relationships, they are not urls.</p>
<p>The Links from Models to Resources are isolated and encapsulated within its own abstraction; which gives us component no. 6 URITemplateAspects (maybe just simplify this to LinkTemplateAspect).</p>
<p>Possible "Application States" are dependent on the request, even though a request must be STATELESS, possible "Application States" may still be determined by the security access; restrictions of media-types or client, which should all be part of the request. If you do stuff with user roles, then make sure you encode within your url.</p>
<p>Component no. 4 is our LinkTemplateProcessor(s) and its responsibility is to evaluate URITemplates within the LinkAwareModels/entities and to determine appropriate state transitions based on the request.</p>
<p>This leads us to the final Option ( well, for this post <img src='http://brettdargan.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<h3>Option 6: Semantic relationships of a "Model to resources" definied via URITemplateAspect and a LinkTemplateProcessor to evaluate the relationships (URITemplates) and sub-entities to determine other "application states"</h3>
<p>Pros:<br />
* Detailed knowledge of the model and related models belong in the Model<br />
* Detailed knowledge of the model to resource of interest is a concern isolated in the URITemplateAspects<br />
* Any possible relationships to other resources can be defined<br />
* Links are very dynamic. The possible state transitions can be determined by the LinkTemplateProcessor, but it can do so decoupled from the detailed relationships of the model to other resources. </p>
<p>The semantic relationships that are defined in the LinkAwareModels, can include uri and other attributes, like rel. The LinkTemplateProcessor can evaluate a lot of the current application state (but not all as the User Agent may have representations from other servers or representations that have been modified by Code-On-Demand) in combination with the semantic relationship to determine the ultimate value of the link to use (relative preferred, of course) and it can determine if that link is a valid state transition. Only if you are an admin do you see this link; or the link retains the current media-type used for this request; so a request for /country/AU.html includes links to cities.html, not just cities. The default negotiation might be something if that is not specified.</p>
<p>* The Processor can operate on objects, prior to rendering to a particular media-type, so if you have a single object model that can render to multiple media-types, you could have less code</p>
<h3>Conclusion</h3>
<p>What do you call, this, maybe Rich Interconnected Model View Resource RIMVR.<br />
Rich in relation to having deep links within a resource representation and from the applicability of those links. That actual uri templates are evaluated late and with some context of the request and application state.</p>
<p>The use of these abstractions, <b>in no way make an application RESTful, that is up to the developers</b>, but hopefully by following some abstractions, like these we will get some clean code and some better understanding of RESTful APIs.</p>
<p><a href="http://brettdargan.com/blog/2009/01/14/hateoas-for-legacy-object-models/">I have some old code, to show this working.</a><br />
One day I'll get a chance to clarify terms and simplify the code <img src='http://brettdargan.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=RIMVR+and+HATEOAS%3A+MVC%2BURITemplateAspects%2C+LinkAwareModels+and+LinkTemplateProcessors+http%3A%2F%2Ftinyurl.com%2F6k2echl" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=RIMVR+and+HATEOAS%3A+MVC%2BURITemplateAspects%2C+LinkAwareModels+and+LinkTemplateProcessors+http%3A%2F%2Ftinyurl.com%2F6k2echl" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/04/29/rimvr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>link and self; rel=&#8221;canonical&#8221; and rev=&#8221;canonical&#8221;</title>
		<link>http://brettdargan.com/blog/2009/01/22/link-and-self/</link>
		<comments>http://brettdargan.com/blog/2009/01/22/link-and-self/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 23:26:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[RESTful]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[uri]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=285</guid>
		<description><![CDATA[This is based on a cross post from http://www.innoq.com/blog/st/2009/01/link_and_self.html. Subbu and &#60;Stefan Tilkov have been discussing URI Equivalence, linking to self and Resource Identities, so here is my view. Subbu's last remark asks the question &#62;&#62;&#62; On January 18, 2009 4:32 AM, Subbu Allamaraju said: Here is a longer response that is longer than a [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>This is based on a cross post from <a class="reference external" href="http://www.innoq.com/blog/st/2009/01/link_and_self.html">http://www.innoq.com/blog/st/2009/01/link_and_self.html</a>.</p>
<p><a class="reference external" href="http://www.subbu.org/blog/2008/12/resource-identity-and-cool-uris">Subbu</a> and <a class="reference external" href="http://www.innoq.com/blog/st/2009/01/link_and_self.html">&lt;Stefan Tilkov</a> have been discussing URI  Equivalence, linking to self and Resource Identities, so here is my view.</p>
<p><a class="reference external" href="http://www.innoq.com/blog/st/2009/01/link_and_self.html#comment-1926">Subbu's last remark asks the question</a></p>
<pre class="doctest-block">
&gt;&gt;&gt;
On January 18, 2009 4:32 AM, Subbu Allamaraju said:
Here is a longer response that is longer than a comment &lt;img src='http://brettdargan.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /&gt;
</pre>
<p><a class="reference external" href="http://www.subbu.org/blog/2009/01/uris-vs-identifiers-take-two">http://www.subbu.org/blog/2009/01/uris-vs-identifiers-take-two</a></p>
<p>IMHO URI non-equivalence does not imply resource non-equivalence.
And if that is really important to your application there SHOULD be ways to handle it.</p>
<p>I agree with Stefan on providing a canonical resource.</p>
<p>You can argue both ways that person and person with address book are either two representations of a person resource, or two different resources, that is the great thing about the Web.</p>
<p>For this case in the atom self link what about using the &lt;b&gt;rev tag&lt;/b&gt; to identify the canonical resource that makes sense for your application.</p>
<p>Since rev also accepts space separated list of link-types you could mark it with both the type and the uri of the canonical resource.</p>
<!-- code-block: html -->
<p>&lt;link href=&quot;<a class="reference external" href="http://www.example.org/person/abc?include=addressBook">http://www.example.org/person/abc?include=addressBook</a>&quot; rel=&quot;self&quot; rev=&quot;canonical <a class="reference external" href="http://www.example.org/person/abc">http://www.example.org/person/abc</a>&quot;/&gt;</p>
<p>As to whether or not <strong>two different entities that returned from different URI</strong> are based on the <strong>same version of the canonical resource or not</strong>:</p>
<p>I would use an EntityTag that encoded some value of resource state and some value of the representation.
Eg. template for xhtml representation may change without resource state and the ETag must change in order to reflect that.</p>
<p>To KISS.</p>
<p>If you had an ETag consisted of something like <strong>&quot;resourceVersion=20,reprVersion={date}&quot;</strong>
Then your application could extract out the self links with <strong>identical rev tags</strong> and extract from the ETag the resourceVersion.</p>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=link+and+self%3B+rel%3D%E2%80%9Dcanonical%E2%80%9D+and+rev%3D%E2%80%9Dcanonical%E2%80%9D+http%3A%2F%2Ftinyurl.com%2F62ppdrq" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=link+and+self%3B+rel%3D%E2%80%9Dcanonical%E2%80%9D+and+rev%3D%E2%80%9Dcanonical%E2%80%9D+http%3A%2F%2Ftinyurl.com%2F62ppdrq" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/01/22/link-and-self/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>URI Design &#8211; Matrix Params for cross-cutting concerns</title>
		<link>http://brettdargan.com/blog/2009/01/16/uri-design-matrix-params-for-cross-cutting-concerns/</link>
		<comments>http://brettdargan.com/blog/2009/01/16/uri-design-matrix-params-for-cross-cutting-concerns/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 14:54:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RESTful]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[uri]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=217</guid>
		<description><![CDATA[Looking at URI design, there are a lot of cross-cutting concerns across many a resource. It would be great to come up with some conventions for the most common. These are some of the ones I've been percolating on. You can see there are a broad range, including: different views or representations of a resource, [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>Looking at URI design, there are a lot of cross-cutting concerns across many a resource.
It would be great to come up with some conventions for the most common.</p>
<p>These are some of the ones I've been percolating on.</p>
<dl class="docutils">
<dt>You can see there are a broad range, including:</dt>
<dd><ul class="first last simple">
<li>different views or representations of a resource, around breadth/depth of it's data and relations</li>
<li>user request based affects on a representation</li>
<li>resource version</li>
<li>application supporting mechanisms, returning fragments and forms or form fragments</li>
<li>temporality</li>
</ul>
</dd>
</dl>
<p>There are a few more, but the trick is having less, right.</p>
<table border="1" class="docutils">
<colgroup>
<col width="6%" />
<col width="94%" />
</colgroup>
<tbody valign="top">
<tr><td>;version</td>
<td>entity version that is</td>
</tr>
<tr><td>;_for_edit ;_for_inline_edit</td>
<td>return html fragment</td>
</tr>
<tr><td>;_at_instant={utc_milliseconds}</td>
<td>get this resource as it would be represented at this point in time</td>
</tr>
<tr><td>;_for_period=iso8601 format</td>
<td>holidays during these periods/durations. die to start and end date ranges. or ;_for_interval</td>
</tr>
<tr><td>;_role=admin</td>
<td>&nbsp;</td>
</tr>
<tr><td>;_repr=code_value</td>
<td>representation of code_value. May also need numcode_value and maybe a triple for code,short name and description</td>
</tr>
<tr><td>;_repr=summary|detail|depth</td>
<td>you get the idea</td>
</tr>
<tr><td>;_repr=no_ambiguity</td>
<td>return a 300 Multiple Choices, if there must be no ambiguity in the request. If the request can not fully determine the intended resource. Often in practice a convention will be followed, like the latest version of the resource. If you support multiple versions do you do what wikipedia does and offers a disambiguity page (as a standard OK response). Although disambiguity pages could cause issues in situations where you expect all particular requests of a resource to return same formatted representation ie. no ambiguity.</td>
</tr>
<tr><td>;additional_param=xyz</td>
<td>#ambiguity resolution</td>
</tr>
<tr><td>;fragment</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>See also <a class="reference external" href="http://wikipedia.com/ISO_8601">ISO8601</a></p>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=URI+Design+%E2%80%93+Matrix+Params+for+cross-cutting+concerns+http%3A%2F%2Ftinyurl.com%2F6hknpzf" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=URI+Design+%E2%80%93+Matrix+Params+for+cross-cutting+concerns+http%3A%2F%2Ftinyurl.com%2F6hknpzf" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/01/16/uri-design-matrix-params-for-cross-cutting-concerns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Query vs. Matrix Params or Path Params</title>
		<link>http://brettdargan.com/blog/2009/01/16/query-vs-matrix-params/</link>
		<comments>http://brettdargan.com/blog/2009/01/16/query-vs-matrix-params/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 14:09:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RESTful]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[uri]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=211</guid>
		<description><![CDATA[I've come across a few posts about Matrix Parameters recently and there is a lot of misunderstanding. There are several old posts that discuss and describe these things: Query Strings Considered Harmful w3c MatrixURIs I've summarised what I think is important: urls with query params won't have their response cached by intermediaries/proxies (at present) matrix [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>I've come across a few posts about Matrix Parameters recently and there is a lot of misunderstanding.</p>
<p>There are several old posts that discuss and describe these things:</p>
<ul class="simple">
<li><a class="reference external" href="http://rest.blueoxen.net/cgi-bin/wiki.pl?QueryStringsConsideredHarmful">Query Strings Considered Harmful</a></li>
<li><a class="reference external" href="http://www.w3.org/DesignIssues/MatrixURIs.html">w3c MatrixURIs</a></li>
</ul>
<dl class="docutils">
<dt>I've summarised what I think is important:</dt>
<dd><ul class="first last simple">
<li>urls with query params <a class="reference internal" href="#won-t-have-their-response-cached-by-intermediaries-proxies-at-present">won't have their response cached by intermediaries/proxies (at present)</a></li>
<li>matrix parameters may appear anywhere in path</li>
<li><a class="reference internal" href="#calculating-the-relative-uri">calculating the relative uri</a> is different</li>
<li>much more than uri convention</li>
<li>query params are generally abused to add new verbs instead of using existing methods on resources</li>
<li>matrix parameters are not resources, they are aspects that help reference a resource in an information space that is difficult to represent within a hierarchy</li>
</ul>
</dd>
</dl>
<p><strong>Tip: If you're not sure if you should use them then don't.</strong></p>
<dl class="docutils">
<dt>Matrix parameters are used with</dt>
<dd><ul class="first last simple">
<li><a class="reference external" href="http://developer.yahoo.com/yui">YUI paging widgets</a></li>
<li><a class="reference external" href="http://rails.org">RoR</a> /some/resource/id;edit</li>
<li>J2ee fallsback to ;jsessionid=xxx when no cookies can be set.</li>
<li><a class="reference external" href="http://jersey.dev.java.net">Jersey (JAX-RS RefImpl) has good support</a></li>
</ul>
</dd>
</dl>
<div class="section" id="caching-issues">
<span id="won-t-have-their-response-cached-by-intermediaries-proxies-at-present"></span><h3>Caching Issues</h3>
<dl class="docutils">
<dt>Intermediaries (proxies) won't cache any url with a query parameter in the url</dt>
<dd><ul class="first last simple">
<li>this is because in the early days of the web, they didn't trust the Cache control information from dynamically generated pages.</li>
<li>Freshness and Validation information are very important pieces of information and the proxy admins took a cautious stance and didn't cache any of it.</li>
</ul>
</dd>
</dl>
<p>As the web has matured the views of devs/admins are changing, the new versions of Squid will default to cache any urls with query parameters</p>
<p>Obviously this could have a very large impact, I've heard google maps image tiles had this issue with some proxies at one time.</p>
</div>
<div class="section" id="relative-uri-calculations">
<span id="calculating-the-relative-uri"></span><h3>Relative URI calculations</h3>
<p>Relative URIs have different affects, as relatives URLs are determined by appending to the Base URI. For Query Parameter requests they are stripped from the Base.</p>
<p>For those still interested I would recommend checking out the following in addition to the <a class="reference external" href="http://tools.ietf.org/html/rfc2616">RFC-2616</a> of course.</p>
<blockquote>
<ul class="simple">
<li><a class="reference external" href="http://www.oreillynet.com/xml/blog/2006/12/the_matrix_revisited.html">the matrix revisited</a></li>
<li><a class="reference external" href="http://rest.blueoxen.net/cgi-bin/wiki.pl?PathsAndQueryStrings">PathsAndQueryStrings</a></li>
<li><a class="reference external" href="http://doriantaylor.com/policy/http-url-path-parameter-syntax">http url path parameter syntax</a></li>
<li><a class="reference external" href="http://blogs.sun.com/sandoz/entry/building_uris">Building URIs</a></li>
</ul>
</blockquote>
</div>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Query+vs.+Matrix+Params+or+Path+Params+http%3A%2F%2Ftinyurl.com%2F6bfbq7g" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Query+vs.+Matrix+Params+or+Path+Params+http%3A%2F%2Ftinyurl.com%2F6bfbq7g" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/01/16/query-vs-matrix-params/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HATEOAS for legacy object models</title>
		<link>http://brettdargan.com/blog/2009/01/14/hateoas-for-legacy-object-models/</link>
		<comments>http://brettdargan.com/blog/2009/01/14/hateoas-for-legacy-object-models/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 15:44:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Patterns]]></category>
		<category><![CDATA[RESTful]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[aop]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hateoas]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=196</guid>
		<description><![CDATA[One of the best aspects of RESTful orientated services is getting your resources connected, possibly even achieving HATEOAS. Making that jump with with legacy object models or data can be tricky, depending on how intrusive you want to be. There is such a large amount of legacy data in various forms, usually with minimal links/relations [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>One of the best aspects of RESTful orientated services is getting your resources connected, possibly even achieving HATEOAS. Making that jump with with legacy object models or data can be tricky, depending on how intrusive you want to be.</p>
<p>There is such a large amount of legacy data in various forms, usually with minimal links/relations that could be leveraged.</p>
<p>So it is a worthy challenge to try and do it in the least intrusive manner possible.</p>
<p>This is one approach that is reasonably decoupled from an existing legacy model.</p>
<p>There are three main parts to this technique:</p>
<ol class="arabic simple">
<li>Enhance your model objects so they have a placeholder/collection so you can accumulate links</li>
<li>Annotate your model at interesting points with <strong>link templates</strong>, around attributes or methods or classes</li>
<li>Use a custom <a class="reference external" href="http://jersey.dev.java.net&quot;">ContainerResponseFilter</a> class of jersey to scan for annotations of interest, then evaluate your link templates (at run time), using the data of your models and any request based information you may require.</li>
</ol>
<p>I chose to enhance my model classes using <a class="reference external" href="http://eclipse.org/aspectj">AspectJ</a> at compile time.</p>
<p><a class="reference external" href="http://brettdargan.com/blog/wp-content/uploads/2009/01/hateoas4legacytar.bz2">Download the source</a></p>
<div class="codeblock"><div class="highlight"><pre>mvn glassfish:run
./curl_test #will hit two urls
</pre></div>
</div><p>and you should see some results, with links like this:</p>
<div class="codeblock"><div class="highlight"><pre><span style="color: #BC7A00">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;country</span> <span style="color: #7D9029">xmlns:ns2=</span><span style="color: #BA2121">&quot;http://www.w3.org/1999/xlink&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;links&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span> <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span>
        <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/cities/Brisbane&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/cities/Sydney&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/cities/Melbourne&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/countries/AU&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;/links&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;cities&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;city&gt;</span>
      <span style="color: #008000; font-weight: bold">&lt;links/&gt;</span>
      <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Brisbane<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;/city&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;city&gt;</span>
        <span style="color: #008000; font-weight: bold">&lt;links/&gt;</span>
        <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Sydney<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;/city&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;city&gt;</span>
      <span style="color: #008000; font-weight: bold">&lt;links/&gt;</span>
      <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Melbourne<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;/city&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;/cities&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;isoCode&gt;</span>AU<span style="color: #008000; font-weight: bold">&lt;/isoCode&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Australia<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/country&gt;</span>
</pre></div>
</div><p>All countries Results</p>
<div class="codeblock"><div class="highlight"><pre><span style="color: #BC7A00">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;countries&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;country</span> <span style="color: #7D9029">xmlns:ns2=</span><span style="color: #BA2121">&quot;http://www.w3.org/1999/xlink&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;links&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/countries/AU&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;/links&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;cities/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;isoCode&gt;</span>AU<span style="color: #008000; font-weight: bold">&lt;/isoCode&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Australia<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/country&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;country</span> <span style="color: #7D9029">xmlns:ns2=</span><span style="color: #BA2121">&quot;http://www.w3.org/1999/xlink&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;links&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/countries/USA&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;/links&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;cities/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;isoCode&gt;</span>USA<span style="color: #008000; font-weight: bold">&lt;/isoCode&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>United States of America<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/country&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/countries&gt;</span>
</pre></div>
</div><p>It is very crufty, but does work in the simple cases.
I haven't had a chance to demonstrate all of the features yet.</p>
<p>I'm likely to further flesh out this example as it is interesting in other RESTful related ways.</p>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=HATEOAS+for+legacy+object+models+http%3A%2F%2Ftinyurl.com%2Fcee6ve" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=HATEOAS+for+legacy+object+models+http%3A%2F%2Ftinyurl.com%2Fcee6ve" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/01/14/hateoas-for-legacy-object-models/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>REST and ROA</title>
		<link>http://brettdargan.com/blog/2008/02/08/rest-and-roa/</link>
		<comments>http://brettdargan.com/blog/2008/02/08/rest-and-roa/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 14:55:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/2008/02/08/rest-and-roa/</guid>
		<description><![CDATA[REST and ROA in a nutshell Tweet This Post]]></description>
			<content:encoded><![CDATA[<p><a href="http://brettdargan.com/blog/2008/02/08/rest-and-roa/rest-and-roa/" rel="attachment wp-att-89" title="REST and ROA">REST and ROA</a> in a nutshell</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=REST+and+ROA+http%3A%2F%2Ftinyurl.com%2F48q75cu" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=REST+and+ROA+http%3A%2F%2Ftinyurl.com%2F48q75cu" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2008/02/08/rest-and-roa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 Operation Aborted not just for the DOM not being ready</title>
		<link>http://brettdargan.com/blog/2007/12/05/ie6-operation-aborted-not-just-for-the-dom-not-being-ready/</link>
		<comments>http://brettdargan.com/blog/2007/12/05/ie6-operation-aborted-not-just-for-the-dom-not-being-ready/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 14:03:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/2007/12/05/ie6-operation-aborted-not-just-for-the-dom-not-being-ready/</guid>
		<description><![CDATA[Most discussions about Operation Aborted only mention when javascript is attempting to manipulate the DOM prior to it being ready. I've seen it fail prior to any of your own js executing. Try this for an experiment have an onload event log something but also return: You have an large list of table results that [...]]]></description>
			<content:encoded><![CDATA[<p>Most discussions about Operation Aborted only mention when javascript is attempting to manipulate the DOM prior to it being ready.</p>
<p>I've seen it fail prior to any of your own js executing.</p>
<p>Try this for an experiment have an onload event log something but also return:</p>
<p>You have an large list of table results that are fed back to the browser with a slight delay per row (ie. an unfortunate logging statement per row)</p>
<p>What comes first?</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=IE6+Operation+Aborted+not+just+for+the+DOM+not+being+ready+http%3A%2F%2Ftinyurl.com%2F5w32e7t" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=IE6+Operation+Aborted+not+just+for+the+DOM+not+being+ready+http%3A%2F%2Ftinyurl.com%2F5w32e7t" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2007/12/05/ie6-operation-aborted-not-just-for-the-dom-not-being-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Directions South 2007</title>
		<link>http://brettdargan.com/blog/2007/12/04/web-directions-south-2007/</link>
		<comments>http://brettdargan.com/blog/2007/12/04/web-directions-south-2007/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 13:52:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/2007/12/04/web-directions-south-2007/</guid>
		<description><![CDATA[Highlights John Allsop - openning comments Sebastian Chan - Government are into mashups Scott Berkun on the Myths of Innovation Chris Willson - MS architect co-chair on HTML5 working group Scott Buchanan &#38; Ben Macguire - Harnessing the law to protect IP Stephen Cox - Ethnography in the design process Rashimi Sinha - Slideshare founder [...]]]></description>
			<content:encoded><![CDATA[<p>Highlights</p>
<ul>
<li>John Allsop - openning comments</li>
<li>Sebastian Chan - Government are into mashups</li>
<li>Scott Berkun on the Myths of Innovation</li>
<li>Chris Willson - MS architect co-chair on HTML5 working group</li>
<li>Scott Buchanan &amp; Ben Macguire - Harnessing the law to protect IP</li>
<li>Stephen Cox - Ethnography in the design process</li>
<li>Rashimi Sinha - Slideshare founder</li>
</ul>
<p>What wasn't mentioned:</p>
<ul>
<li>REST</li>
<li>java</li>
<li>testing</li>
</ul>
<p>Google maps by Raul Vera</p>
<p>Bert Bos - CSS level 3, vertical text layout, like for japanese; new grid positions; advanced grid layout; rounded cornersScott Berkun</p>
<p>Great talk on the <a href="http://www.amazon.com/Myths-Innovation-Scott-Berkun/dp/0596527055/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1196776653&#038;sr=8-1">myths of innovation</a></p>
<p>Other worthy talks</p>
<p>tidbits:</p>
<p>http://www.sharedspace.org</p>
<p>http://www.slideshare.net/search/shiftlearning</p>
<p>http://www.earthfromabove.whereis.com</p>
<p>australian stock photos</p>
<p>Recommended books:</p>
<p>the double helix</p>
<p>vitruvius - tn books on architecture</p>
<p>Diffusions of innovation</p>
<p>Wisdom of crowds</p>
<p>emergence</p>
<p>ethnography for marketers</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Web+Directions+South+2007+http%3A%2F%2Ftinyurl.com%2F64msm37" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Web+Directions+South+2007+http%3A%2F%2Ftinyurl.com%2F64msm37" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2007/12/04/web-directions-south-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Packaging Custom Widgets with Dojo</title>
		<link>http://brettdargan.com/blog/2006/08/14/packaging-custom-widgets-with-dojo/</link>
		<comments>http://brettdargan.com/blog/2006/08/14/packaging-custom-widgets-with-dojo/#comments</comments>
		<pubDate>Mon, 14 Aug 2006 00:41:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=76</guid>
		<description><![CDATA[Recently I was involved in investigating integration of a client site with an affiliate site. Both parties were interested in avoiding iframes and it's baggage. Ideally we were looking for a solution that involved: minimal (html,css,js) code on affiliates pages. After all who would want deployment dependencies across organisations? dynamic json data served from our [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was involved in investigating integration of a client site with an affiliate site.</p>
<p>Both parties were interested in avoiding iframes and it's baggage.</p>
<p>Ideally we were looking for a solution that involved:
<ul>
<li>minimal (html,css,js) code on affiliates pages. After all who would want deployment dependencies across organisations?</li>
<li>dynamic <a href="http://json.org">json data</a> served from our site</li>
<li>long lived highly compressed components</li>
<li>efficient use of connections to our server</li>
</ul>
<p>We evaluated <a href="http://dojotoolkit.org">dojo</a> and <a href="http://code.google.com/webtoolkit/">google web toolkit</a></p>
<p>Dojo won out, among it's many features it has:</p>
<ul>
<li>Nice Custom Widgets</li>
<li><a href="http://ajaxian.com/archives/ajax-experience-day-2-alex-russells-dojo-in-depth">Cross Domain IO</a> via <a href="http://archive.dojotoolkit.org/nightly/tests/io/test_ScriptSrcIO.html">ScriptSrcIO</a></li>
<li><a href="http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book52">compression and packaging into a single js</a>. create your own profile listing your dependencies and dojo buildscripts</li>
<li><a href="http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book48">XDomain package loading</a>. You need to build it from source, Although this wasn't required for us in the end.</li>
</ul>
<h3>Widget Issues</h3>
<p>Unfortunately widgets are not completely self-contained. CSS is a bit of a problem. Typical custom widget will result in your css being inlined into your html widget, but this isn't required or always the bestway to go.</p>
<p>CSS relative image references are resolved relative to the host the base page was served from not our site.  </p>
<p>We decided to keep our relative image references and have our stylesheet added to our affiliate pages dynamically.</p>
<p>Give namespaces are changing in new version we didn't create our own and just used dojo.widget...</p>
<h3>Should Dojo be called Sumo? (says teagles)</h3>
<p>Most ajax libraries are fairly heavy, you are looking at atleast 100K with the average closer to 200K to get simple io, events, effects and dom manipulation functionality. Disclaimer, it was a pretty quick scan a couple of weeks ago, of <a href="http://mochikit.org">mochikit</a>, <a href="http://dojotoolkit.org">dojo</a> and <a href="http://script.aculo.us/">scriptaculous</a>. </p>
<p>After various packaging experimentation the Animation.js heavyweight seemed pretty core if you want to use custom widgets.</p>
<h3>Why GWT wasn't for us</h3>
<ul>
<li>binary format</li>
<li>can't use 5.0 features</li>
<li>not all features supported, ie new ArrayList(size)</li>
<li>active monitoring</li>
<li>components served off <a href="http://www.google.com">google</a></li>
<li>...</li>
</ul>
<p>GWT does have some upsides though:</p>
<ul>
<li>testability</li>
<li>small footprint</li>
<li>cross browser compatibility verified by google</li>
</ul>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Packaging+Custom+Widgets+with+Dojo+http%3A%2F%2Ftinyurl.com%2F6lbctrz" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Packaging+Custom+Widgets+with+Dojo+http%3A%2F%2Ftinyurl.com%2F6lbctrz" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2006/08/14/packaging-custom-widgets-with-dojo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

