<?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:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Virtuous Code &#187; rest</title>
	<atom:link href="http://devblog.avdi.org/tag/rest/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.avdi.org</link>
	<description>&#34;The three virtues of a programmer: laziness, impatience, and hubris&#34; -- Larry Wall</description>
	<lastBuildDate>Wed, 16 May 2012 16:59:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Linkdump #3</title>
		<link>http://devblog.avdi.org/2011/02/25/linkdump-3/</link>
		<comments>http://devblog.avdi.org/2011/02/25/linkdump-3/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 16:21:10 +0000</pubDate>
		<dc:creator>Avdi Grimm</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[cohesion]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[conductor]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[producer]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=1100</guid>
		<description><![CDATA[Conduce From Ara T. Howard, &#34;a model+view component for rails that combines the conductor and presenter&#160;pattern via a model capable of generating view-centric methods&#34;. A single Gist which is interesting both for what it does, and for the way it &#8230; <a href="http://devblog.avdi.org/2011/02/25/linkdump-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<ul class="diigo-linkroll">
<li>
<p class="diigo-link"><a href="https://gist.github.com/843071">Conduce</a></p>
<p class="diigo-description">From Ara T. Howard, &quot;a model+view component for rails that combines the conductor and presenter&nbsp;pattern via a model capable of generating view-centric methods&quot;. A single Gist which is interesting both for what it does, and for the way it is implemented.</p>
<p class="diigo-tags"><span>tags:</span>                        <a href="http://www.diigo.com/user/avdigrimm/development">development</a>             <a href="http://www.diigo.com/user/avdigrimm/ruby">ruby</a>             <a href="http://www.diigo.com/user/avdigrimm/rails">rails</a>             <a href="http://www.diigo.com/user/avdigrimm/patterns">patterns</a>             <a href="http://www.diigo.com/user/avdigrimm/view">view</a>             <a href="http://www.diigo.com/user/avdigrimm/model">model</a>             <a href="http://www.diigo.com/user/avdigrimm/conductor">conductor</a>             <a href="http://www.diigo.com/user/avdigrimm/presenter">presenter</a>             <a href="http://www.diigo.com/user/avdigrimm/conducer">conducer</a></p>
</li>
<li>
<p class="diigo-link"><a href="http://www.vanderburg.org/Blog/Software/Development/cohesion.rdoc">Glenn Vanderburg on Cohesion</a></p>
<p class="diigo-description">Terrific article on the lesser-understood member of the coupling/cohesion duo.</p>
<p class="diigo-tags"><span>tags:</span>                        <a href="http://www.diigo.com/user/avdigrimm/development">development</a>             <a href="http://www.diigo.com/user/avdigrimm/design">design</a>             <a href="http://www.diigo.com/user/avdigrimm/oo">oo</a>             <a href="http://www.diigo.com/user/avdigrimm/oop">oop</a>             <a href="http://www.diigo.com/user/avdigrimm/architecture">architecture</a>             <a href="http://www.diigo.com/user/avdigrimm/cohesion">cohesion</a>             <a href="http://www.diigo.com/user/avdigrimm/coupling">coupling</a></p>
<ul class="diigo-annotations">
<li>
<div class="diigoContent">
<div class="diigoContentInner">Cohesion comes from the same root word that &quot;adhesion&quot; comesfrom. It&rsquo;s a word about <em>sticking</em>. When something<em>adheres</em> to something else (when it&rsquo;s <em>adhesive</em>, inother words) it&rsquo;s a one-sided, external thing: something (like glue)is sticking one thing to another. Things that are <em>cohesive</em>, on theother hand, naturally stick to each other because they are of like kind, orbecause they fit so well together. Duct tape <em>adheres</em> to thingsbecause it&rsquo;s sticky, not because it necessarily has anything incommon with them. But two lumps of clay will <em>cohere</em> when you putthem together, and matched, well-machined parts sometimes seem to coherebecause the fit is so precise. <em>Adhesion</em> is one thing sticking toanother; <em>cohesion</em> is a mutual relationship, with two things<em>sticking together</em>.</div>
</p></div>
</li>
</ul>
</li>
<li>
<p class="diigo-link"><a href="http://pusherapp.com">Pusher: bringing the realtime web to your apps with HTML5 Websockets</a></p>
<p class="diigo-tags"><span>tags:</span>                        <a href="http://www.diigo.com/user/avdigrimm/development">development</a>             <a href="http://www.diigo.com/user/avdigrimm/web">web</a>             <a href="http://www.diigo.com/user/avdigrimm/html5">html5</a>             <a href="http://www.diigo.com/user/avdigrimm/websockets">websockets</a></p>
</li>
<li>
<p class="diigo-link"><a href="https://github.com/tmm1/rbtrace">tmm1/rbtrace &#8211; GitHub</a></p>
<p class="diigo-tags"><span>tags:</span>                        <a href="http://www.diigo.com/user/avdigrimm/development">development</a>             <a href="http://www.diigo.com/user/avdigrimm/ruby">ruby</a></p>
<ul class="diigo-annotations">
<li>
<div class="diigoContent">
<div class="diigoContentInner">like strace, but for ruby code</div>
</p></div>
</li>
</ul>
</li>
<li>
<p class="diigo-link"><a href="http://najafali.com/php-is-better-than-ruby.html">najafali.com &#8211; Why PHP is better than Ruby</a></p>
<p class="diigo-description">This guy is completely right. I don&#8217;t know what I was thinking all these years.</p>
<p class="diigo-tags"><span>tags:</span>                        <a href="http://www.diigo.com/user/avdigrimm/development">development</a>             <a href="http://www.diigo.com/user/avdigrimm/ruby">ruby</a>             <a href="http://www.diigo.com/user/avdigrimm/php">php</a>             <a href="http://www.diigo.com/user/avdigrimm/humor">humor</a></p>
<ul class="diigo-annotations">
<li>
<div class="diigoContent">
<div class="diigoContentInner">This code is incomprehensible&#8230; First of all, there are no curly braces anywhere. Curly braces make me feel safe and loved, and I don&#8217;t see any curly braces here. Also, I lose all sense of balance if I don&#8217;t have paranthesis.</div>
</p></div>
</li>
</ul>
</li>
<li>
<p class="diigo-link"><a href="http://37signals.com/svn/posts/2699-making-sense-with-rubys-unless">Making sense with Ruby&#8217;s &quot;unless&quot; &#8211; (37signals)</a></p>
<p class="diigo-tags"><span>tags:</span>                        <a href="http://www.diigo.com/user/avdigrimm/development">development</a>             <a href="http://www.diigo.com/user/avdigrimm/ruby">ruby</a></p>
<ul class="diigo-annotations">
<li>
<div class="diigoContent">
<div class="diigoContentInner">Never, ever, ever use an <code>else</code> clause with an <code>unless</code> statement.</div>
</p></div>
</li>
</ul>
</li>
<li>
<p class="diigo-link"><a href="http://liveast.rubyforge.org">LiveAST: Live Abstract Syntax Trees</a></p>
<p class="diigo-description">Interesting project for grabbing syntax trees from dynamically generated code.</p>
<p class="diigo-tags"><span>tags:</span>                        <a href="http://www.diigo.com/user/avdigrimm/abstract">abstract</a>             <a href="http://www.diigo.com/user/avdigrimm/syntax">syntax</a>             <a href="http://www.diigo.com/user/avdigrimm/ruby">ruby</a>             <a href="http://www.diigo.com/user/avdigrimm/development">development</a></p>
</li>
<li>
<p class="diigo-link"><a href="http://www.infoq.com/interviews/pike-concurrency">InfoQ: Rob Pike on Parallelism and Concurrency in Programming Languages</a></p>
<p class="diigo-description">Ever wondered what the difference between parallelism and concurrency is? Rob can tell you. Lots of interesting history of obscure concurrent programming languages here.</p>
<p class="diigo-tags"><span>tags:</span>                        <a href="http://www.diigo.com/user/avdigrimm/development">development</a></p>
</li>
<li>
<p class="diigo-link"><a href="http://www.informit.com/articles/article.aspx?p=1566460">InformIT: Versioning REST Services &gt; Hypermedia as the Engine of Application State</a></p>
<p class="diigo-description">Shows how to use vendor-specific mimetypes along with versions.</p>
<p class="diigo-tags"><span>tags:</span>                        <a href="http://www.diigo.com/user/avdigrimm/rest">rest</a>             <a href="http://www.diigo.com/user/avdigrimm/http">http</a>             <a href="http://www.diigo.com/user/avdigrimm/web">web</a>             <a href="http://www.diigo.com/user/avdigrimm/development">development</a></p>
</li>
</ul>
<p class="diigo-ps">Posted from <a href="http://www.diigo.com">Diigo</a>. The rest of my favorite links are <a href="http://www.diigo.com/user/avdigrimm">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.avdi.org/2011/02/25/linkdump-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>REST Resources</title>
		<link>http://devblog.avdi.org/2011/02/17/rest-resources/</link>
		<comments>http://devblog.avdi.org/2011/02/17/rest-resources/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 18:44:32 +0000</pubDate>
		<dc:creator>Avdi Grimm</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[hateoas]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=1050</guid>
		<description><![CDATA[From time to time people ask me questions about RESTful architecture. I thought it might be helpful to list the resources that I keep near at hand for asnwering tricky REST questions. Standards: RFC2616 Hypertext Transfer Protocol: If you haven&#8217;t read &#8230; <a href="http://devblog.avdi.org/2011/02/17/rest-resources/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>From time to time people ask me questions about <a class="zem_slink" title="Representational State Transfer" rel="wikipedia" href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</a> architecture. I thought it might be helpful to list the resources that I keep near at hand for asnwering tricky REST questions.</p>
<h2>Standards:</h2>
<ul>
<li><a href="http://tools.ietf.org/html/rfc2616">RFC2616 Hypertext Transfer Protocol</a>: If you haven&#8217;t read this RFC, you might be surprised at what you don&#8217;t know about HTTP. I keep a printed copy nearby at all times.</li>
<li><a href="http://tools.ietf.org/html/rfc5988">RFC5988: Web Linking</a>. You might not have heard of this one, but I think it&#8217;s one of the more important recent developments in HTTP from a RESTful standpoint. REST is all about hyperlinks, but how do you link a non-HTML resource &#8211; like an image, for instance &#8211; to other resources? This RFC tells you how.</li>
<li><a href="http://tools.ietf.org/html/draft-gregorio-uritemplate-04">URI Templates</a>. This one&#8217;s still a draft. In general forcing clients to build their own URIs is bad form; contrary to a zillion &#8220;How to use our RESTful API&#8221; articles you may have read, URIs are supposed to be opaque. However, sometimes URI construction is inevitable; when that&#8217;s the case, we can at least specify it in a machine-understandable format with URI templates.</li>
</ul>
<h2>Books:</h2>
<p><a href="http://www.amazon.com/HTTP-Definitive-Guide-David-Gourley/dp/1565925092%3FSubscriptionId%3DAKIAIRXKO4LLU2ACVMRQ%26tag%3Dthlafa-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1565925092"><img style="margin: 3px;" src="http://ecx.images-amazon.com/images/I/51IUamGxHkL._SL75_.jpg" alt="" width="56" height="75" /></a><a href="http://www.amazon.com/Restful-Web-Services-Leonard-Richardson/dp/0596529260%3FSubscriptionId%3DAKIAIRXKO4LLU2ACVMRQ%26tag%3Dthlafa-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596529260"><img style="margin: 3px;" src="http://ecx.images-amazon.com/images/I/51c26sG-DDL._SL75_.jpg" alt="" width="57" height="75" /></a><a href="http://www.amazon.com/RESTful-Web-Services-Cookbook-Scalability/dp/0596801688%3FSubscriptionId%3DAKIAIRXKO4LLU2ACVMRQ%26tag%3Dthlafa-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596801688"><img style="margin: 3px;" src="http://ecx.images-amazon.com/images/I/41ylZjFsWYL._SL75_.jpg" alt="" width="57" height="75" /></a><img style="margin: 3px;" src="http://ecx.images-amazon.com/images/I/51xSVWRSEFL._SL75_.jpg" alt="" width="57" height="75" /></p>
<ul>
<li><a class="zem_slink" title="HTTP: The Definitive Guide" rel="amazon" href="http://www.amazon.com/HTTP-Definitive-Guide-David-Gourley/dp/1565925092%3FSubscriptionId%3D0G81C5DAZ03ZR9WH9X82%26tag%3Dthlafa-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1565925092">HTTP: The Definitive Guide</a>. A good HTTP reference is essential, and this book offers a lot more exposition and examples than plain RFC2616. It also draws in related material so you don&#8217;t have to go hunting down all the referenced RFCs yourself.</li>
<li><a href="http://www.amazon.com/Restful-Web-Services-Leonard-Richardson/dp/0596529260%3FSubscriptionId%3DAKIAIRXKO4LLU2ACVMRQ%26tag%3Dthlafa-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596529260">Restful Web Services</a>. Probably the best guide available for building REST services.</li>
<li><a href="http://www.amazon.com/RESTful-Web-Services-Cookbook-Scalability/dp/0596801688%3FSubscriptionId%3DAKIAIRXKO4LLU2ACVMRQ%26tag%3Dthlafa-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596801688">RESTful Web Services Cookbook: Solutions for Improving Scalability and Simplicity</a>. The companion volume to RESTful Web Services.</li>
<li><a href="http://www.amazon.com/REST-Practice-Hypermedia-Systems-Architecture/dp/0596805829%3FSubscriptionId%3DAKIAIRXKO4LLU2ACVMRQ%26tag%3Dthlafa-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0596805829">REST in Practice: Hypermedia and Systems Architecture</a> &#8211; I haven&#8217;t delved deeply into this one yet, but it seems to deal with higher-level patterns built on the principles laid out in the other books.</li>
</ul>
<h2>Articles:</h2>
<ul>
<li><a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm">Roy Fielding&#8217;s thesis</a>. Duh.</li>
<li><a href="http://martinfowler.com/articles/richardsonMaturityModel.html">The Richardson Maturity Model</a>. Characterizing different levels of RESTfullness.</li>
<li><a href="http://barelyenough.org/blog/2008/05/versioning-rest-web-services/">Versioning REST Web Services</a>, by Peter Williams. In which we learn a much better alternative to API endpoints with /v1/ and /v2/ in the URL.</li>
<li><a href="http://www.informit.com/articles/article.aspx?p=1566460">Versioning REST Services</a>, by Scott Seely. An interesting variation on the scheme above that uses mimetype version arguments instead of a version built-in to the mimetype.</li>
<li><a href="http://www.theamazingrando.com/blog/?p=107">Your Web Service Might Not be RESTful if&#8230;</a> by Paul Sadauskas. Think you know REST? Think again.</li>
<li><a href="http://timeless.judofyr.net/haters-gonna-hateoas">Haters gonna HATEOAS</a>, by Magnus Holm and Steve Klabnik. One of the better explanations of just what the hell Hypertext As The Engine Of Application State (HATEOAS) means.</li>
<li><a href="http://blogs.sun.com/craigmcc/entry/why_hateoas">Why HATEOAS</a>, by Craig McLanahan. OK, so now you know your API isn&#8217;t really RESTful. Why should you care? This article provides a few reasons.</li>
</ul>
<p>What about you? What are your favorite resources on RESTful architecture?</p>
<p>Note: Any comments to the tune of &#8220;blah blah REST orthodoxy blah blah zealots blah blah real world blah blah who cares&#8221; will be summarily deleted. The books and articles listed above are by real developers who have solved real deficiencies in HTTP APIs using RESTful principles. If you and/or your users don&#8217;t have the problems these techniques address, <strong>that&#8217;s fine</strong>. This article isn&#8217;t for you. Move along.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_a.png?x-id=bbae9320-2fe8-4ad3-90d3-77e4ef293518" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://devblog.avdi.org/2011/02/17/rest-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Rack-like library for HTTP Clients</title>
		<link>http://devblog.avdi.org/2010/12/03/a-rack-like-library-for-http-clients/</link>
		<comments>http://devblog.avdi.org/2010/12/03/a-rack-like-library-for-http-clients/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 19:55:24 +0000</pubDate>
		<dc:creator>Avdi Grimm</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rack]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=886</guid>
		<description><![CDATA[Faraday is an HTTP client library inspired by Rack. Requests and Responses go through middleware which allow for abstraction and modular code. via Writing modular HTTP client code with Faraday &#124; Adventures In Coding. Strike that off my list of &#8230; <a href="http://devblog.avdi.org/2010/12/03/a-rack-like-library-for-http-clients/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Faraday is an HTTP client library inspired by Rack. Requests and Responses go through middleware which allow for abstraction and modular code.</p></blockquote>
<p>via <a href="http://adventuresincoding.com/2010/09/writing-modular-http-client-code-with-faraday/">Writing modular HTTP client code with Faraday | Adventures In Coding</a>.</p>
<p>Strike that off my list of libraries to write. I&#8217;m very eager to play with this.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.avdi.org/2010/12/03/a-rack-like-library-for-http-clients/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Viewing REST service responses in a browser</title>
		<link>http://devblog.avdi.org/2009/10/20/viewing-rest-service-responses-in-a-browser/</link>
		<comments>http://devblog.avdi.org/2009/10/20/viewing-rest-service-responses-in-a-browser/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 23:46:57 +0000</pubDate>
		<dc:creator>Avdi Grimm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/?p=244</guid>
		<description><![CDATA[Have you ever had this experience? You&#8217;re debugging some RESTful service and trying to figure out why it&#8217;s returning 500s. So you dump the response body to STDOUT and HOLY HAND GRENADE THAT&#8217;S A LOT OF HTML!!! Wouldn&#8217;t it be &#8230; <a href="http://devblog.avdi.org/2009/10/20/viewing-rest-service-responses-in-a-browser/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever had this experience? You&#8217;re debugging some RESTful service and trying to figure out why it&#8217;s returning 500s. So you dump the response body to STDOUT and <strong>HOLY HAND GRENADE THAT&#8217;S A LOT OF HTML!!!</strong>  Wouldn&#8217;t it be nice if you could just look at it in a browser?</p>
<p>Here ya go:</p>
<pre name="code" class="ruby">
require 'tempfile'

def browse_string(body)
  Tempfile.open('browse_string') do |f|
    browser = ENV.fetch('BROWSER') { 'firefox' }
    f.write(body)
    f.close
    puts "Starting browser #{browser} with response..."
    unless system(browser, f.path)
      warn "Error starting browser #{browser}"
    end
  end
end
</pre>
<p>Just drop that in your debug script, in your .irbrc, or make a <a href="http://tagaholic.me/boson/">Boson</a> command out of it.  Then call it with the HTML you want to view:</p>
<pre name="code" class="ruby">
browse_string(response.body)
</pre>
<p>It even respects the <a href="http://catb.org/~esr/BROWSER/">BROWSER</a> environment convention (well, sort of).</p>
<p>I&#8217;ve <a href="http://gist.github.com/214722">put the code on Gist</a> as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.avdi.org/2009/10/20/viewing-rest-service-responses-in-a-browser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

