<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Perpetually Nonchalant: Time For Some REST</title>
    <link>http://www.shorrockin.com/articles/2006/09/06/time-for-some-rest</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>where the voices inside my head express themselves</description>
    <item>
      <title>Time For Some REST</title>
      <description>&lt;p&gt;A while back my wife had planned a trip up to Kelowna for a few days (leaving in an hour) with some friends. In light of my current predicament regarding work the thought of rest and relaxation doesn't seem very well timed, but maybe this logic is flawed.&lt;/p&gt;

&lt;p&gt;I was at &lt;a href="http://en.wikipedia.org/wiki/BJJ"&gt;BJJ&lt;/a&gt; practice last night and the ebb and flow of the situation was such that everything was effortless. My opponents were coming to me, they were falling into my traps, I didn't force anything I just let the situation dictate itself. As I reflect back this is similar to how my career has unfolded.&lt;/p&gt;

&lt;p&gt;I've never really had to look hard for work, generally it has always found me. I suppose this is why I'm starting to get worried as it's a new experience, but like everything, experiences are to embraced and not ran away from. Things have always worked out in the past and I'm confident that they will continue to do so. I just need to let go and let the situation flow and the pieces drop where they may. This is not to say I should sit back and wait for the phone to ring but there is no point in worrying about tomorrow when tomorrow will worry about itself. This is why I think this period of rest may be well earned. &lt;/p&gt;

&lt;p&gt;Speaking of &lt;a href="http://en.wikipedia.org/wiki/REST"&gt;REST&lt;/a&gt;, this newly created buzzword has really peaked my interest. Similar concepts (&lt;a href="http://en.wikipedia.org/wiki/SOAP"&gt;SOAP&lt;/a&gt; I'm looking at you) have always struck me as a poorly constructed mess, but &lt;a href="http://en.wikipedia.org/wiki/REST"&gt;REST&lt;/a&gt; appears to take HTTP and finally utilize it as it's designers had intended. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/REST"&gt;REST&lt;/a&gt; utilizes the CRUD (Create, Read, Update, Delete) line of thinking, and maps those commands to HTTP using the following relationships:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;C&lt;/strong&gt;reate -&gt; HTTP PUT&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;R&lt;/strong&gt;ead -&gt; HTTP GET&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;U&lt;/strong&gt;pdate -&gt; HTTP POST&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;D&lt;/strong&gt;elete -&gt; HTTP DELETE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These commands become your verbs, while the HTTP URI becomes your noun. Therefore, where before we may have had the following to perform the CRUD functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;POST http://www.mywebsite.com/person?command=create&amp;amp;name=chris&lt;/li&gt;
&lt;li&gt;GET http://www.mywebsite.com/person?command=read&amp;amp;id=1&lt;/li&gt;
&lt;li&gt;POST http://www.mywebsite.com/person?command=updatee&amp;amp;name=christopher&lt;/li&gt;
&lt;li&gt;POST http://www.mywebsite.com/person?command=delete&amp;amp;id=1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using &lt;a href="http://en.wikipedia.org/wiki/REST"&gt;REST's&lt;/a&gt; line of thinking we now get (Ok - the following isn't exact as &lt;a href="http://en.wikipedia.org/wiki/REST"&gt;REST&lt;/a&gt; utilizes XML to define the data, but it illustrates my point):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PUT http://www.mywebsite.com/person&amp;amp;name=chris&lt;/li&gt;
&lt;li&gt;GET http://www.mywebsite.com/person/1&lt;/li&gt;
&lt;li&gt;POST http://www.mywebsite.com/person/1&amp;amp;name=christopher&lt;/li&gt;
&lt;li&gt;DELETE http://www.mywebsite.com/person/1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not only is this much cleaner than the way we've done things in the past it forces the developer into a design that has been proven many times over. &lt;a href="http://en.wikipedia.org/wiki/REST"&gt;REST&lt;/a&gt; at it's core won't change the world, but it is a nice little way of cleaning up a mess that SOAP couldn't.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;As a side note I've now wrote this entry out twice as when I tried to paste I accidently pressed command-w (I'm using the &lt;a href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard"&gt;Dvorak&lt;/a&gt; keyboard layout which puts these two keys side by side). So if things seem a little rushed and not fully explained I'll assure you it was better in the first copy ;)&lt;/em&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 06 Sep 2006 11:20:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:d0a48a86-9bd8-4689-aabf-a75455abdeed</guid>
      <author>chris@shorrockin.com (Chris Shorrock)</author>
      <link>http://www.shorrockin.com/articles/2006/09/06/time-for-some-rest</link>
      <category>Programming</category>
      <category>General</category>
      <category>vacation</category>
      <category>REST</category>
      <category>design</category>
      <category>SOAP</category>
      <trackback:ping>http://www.shorrockin.com/articles/trackback/18</trackback:ping>
    </item>
  </channel>
</rss>
