<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[REST - Random Thoughts]]></title><description><![CDATA[About business and information technology]]></description><link>https://christoffer.soop.ch/</link><image><url>https://christoffer.soop.ch/favicon.png</url><title>REST - Random Thoughts</title><link>https://christoffer.soop.ch/</link></image><generator>Ghost 5.46</generator><lastBuildDate>Thu, 11 Jun 2026 10:22:31 GMT</lastBuildDate><atom:link href="https://christoffer.soop.ch/tag/rest/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[REST for Scott]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><em>At the thanksgiving dinner of a friend from work I tried to explain REST-ful applications &#x2013; and I think I failed miserably. Even though there are plenty of good introductions out there I felt I needed to organize my thoughts a bit. Having some spare time on the train on</em></p>]]></description><link>https://christoffer.soop.ch/rest-for-scott/</link><guid isPermaLink="false">645818765c4dcc000153cb5a</guid><category><![CDATA[Architecture]]></category><category><![CDATA[REST]]></category><category><![CDATA[Web]]></category><dc:creator><![CDATA[Christoffer Soop]]></dc:creator><pubDate>Sat, 28 Nov 2009 08:07:22 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p><em>At the thanksgiving dinner of a friend from work I tried to explain REST-ful applications &#x2013; and I think I failed miserably. Even though there are plenty of good introductions out there I felt I needed to organize my thoughts a bit. Having some spare time on the train on the way home I made a second, more structured attempt in the form of this blog post.</em></p>
<p>Imagine you are a web developer and is asked by a friend with a travel agency to help out create a web site for his company. Among the services on the site is a small web application for searching for hotels recommended by the agency. These hotels have been carefully vetted for the agency&#x2019;s customer segment and useful hotel information is stored in a database.</p>
<p>Let us assume the web application manages the namespace under the URL</p>
<blockquote>
<p><a href="http://qualitytravel.com/hotel?ref=christoffer.soop.ch">http://qualitytravel.com/hotel</a></p>
</blockquote>
<p>One way to construct the application is by storing e.g. navigation state in a server side session or as post parameters in the HTTP requests. Or maybe use an AJAX user interface where parts of the page is updated asynchronously in the background. These approaches are, however, incompatible with the basic requirement of you friend the the travel agent, who frequently copies the URL of a particular hotel and sends it per email to potential customers. He would also like his customers and all other users of the web site to be able to send URLs, create bookmarks etc. Only by creating stable, re-usable URL&#x2019;s is this easily accomplished. Thus you decide on a basic categorization scheme where each hotel is listed under</p>
<blockquote>
<p><a href="http://qualitytravel.com/hotel/?ref=christoffer.soop.ch">http://qualitytravel.com/hotel/</a><country-code>/<city>/<hotel-name></hotel-name></city></country-code></p>
</blockquote>
<p>Where <country-code> is the two letter ISO code for the country, <city> the city name in english using only ascii characters and <hotel-name> is a unique name of the hotel (unique at least within the country). By typing in a URL like</hotel-name></city></country-code></p>
<blockquote>
<p><a href="http://qualitytravel.com/hotel/se/stockholm/grand-hotel?ref=christoffer.soop.ch">http://qualitytravel.com/hotel/se/stockholm/grand-hotel</a></p>
</blockquote>
<p>&#x2026; in a web browser you would end up with the HTML page describing the Grand Hotel in Stockholm, Sweden.</p>
<p>Your friend is very ambitious but would like to start out small. Uptime is of course important but not critical and you offer to host the site on your server at your place for a minor fee per month. (This would help pay the electricity and internet connection bills.)</p>
<p>Now, your friend has a business partner who organizes conferences in different countries around the globe. The business partner would like to link to specific hotels on your site, hotels your friend has arranged special deals and have pre-booked a number of rooms for. Since you are using stable and predictable URLs this is no big deal, for any particular conference the business partner can easily add the reference on a web page, add them in emails sent out to the participants and even in printed hard copy.</p>
<p>As the partnership between your friend and his business partner deepens, the business partner would like tighter integration between the two web sites. In particular he would like to create a mashup application where each conference has a map with all the hotels printed at the correct geographic location. Since your friend has stored the exact geo location of each hotel in his database it should not be too difficult to achieve.</p>
<p>Being well versed in XML and enterprise standards you now ponder a bit on web services. You could of course create a web service with a method which would accept a list of hotel identifiers and return a list coordinates&#x2026; After some deliberation you come to the conclusion it would be easiest to use the URLs as identifiers. They are unambiguous and you do not have to expose the primary keys of the database to the internet and there is no need to create new unique external identifiers. On top of that adding the identifiers to the mashup will be easy since the URLs are already used on the conference web page.</p>
<p>Thinking a bit further you realize that in the future there potentially is&#xA0; more information which could be useful, not just the coordinates. Right now you do not know exactly what information that would be, but if you return a list of XML documents containing basic information on each hotel and with geo-coordinates, you can always expend the XML document format to include additional information at a later stage. At least as long you are careful to keep the format backwards compatible. This you do by not changing the meaning and syntax of the existing XML and make sure the XML elements have the same position relative to the root element (i.e. that the XPath for the elements is stable).</p>
<p>Finally, you realize that instead of taking the pain of having to create a web service with SOAP, WSDLs etc you decide that each hotel URL should return the corresponding XML if the client asks to get the hotel information in XML format instead of HTML. This can easily be accomplished by using the standard HTTP content negotiation, i.e. the client sends a list of desired formats and the server responds with a document in one of the formats if it can.</p>
<p>The changes to the existing application are relatively minor, you only need to implement the content negotiation feature and in addition to render HTML you will need a mechanism to render XML. (In Java, using servlets, servlet filters and a templateing mechanism sounds like a good approach.)</p>
<p>The result is a huge success. Business is booming for your friend and traffic to your server is increasing at an alarming rate. You are sure that any minute your ISP will knock on the door telling you you are violating the fair use clause of your contract. In addition, uptime is becoming more of a concern. If not for the load so at least for redundancy you need two servers. You decide to move the web site to a hosting facility. Since state is not kept in a server side session you realize that clustering will be trivial. Each request is independent of the previous meaning it can land on either server without complication. This also means adding more servers to handle a larger load will be a breeze.</p>
<p>Some time later your friend has found an additional business partner &#x2013; this guy for some reason wants to create an AJAX client which uses the hotel information. The AJAX guys, programming in client side Java script, do not really like XML and prefer something called JSON. Would it be possible to add JSON support? In addition it would be nice if you could create a downloadable PDF for each hotel&#x2026;</p>
<p>Having the infrastructure already set up, all is needed is to add two new rendering templates, one for JSON and one for PDF&#x2019;s and add the two new formats to the lists served by the server.</p>
<p>&#x2013;</p>
<p>*The above scenario describes using REST &#x2013; <strong>RE</strong>presentational <strong>S</strong>tate <strong>T</strong>ransfer &#x2013; for building a web application. The text strives to illustrate the fundamental REST-ful principle of decoupling the reference of an object from its actual representation. It can also be said that in REST you take a resource or document oriented approach to software development, i.e. development is data-driven. This is opposed to service orientation with an RPC style of defining interfaces where focus is not on the data but rather on what you do with data; the focus is on the verbs instead of the nouns. In REST the actions are a well defined minimum like the four most well known HTTP verbs: GET, POST, PUT and DELETE. Above, only the implied use of GET is shown.<br>
*</p>
<p><em>Using REST principles is not constrained to web applications. It has been suggested that REST should be used instead of SOAP based web services in a SOA architecture, thus imbuing some of the webs scalability and robustness in an Enterprise Integraion scenario. Gartner has termed it <a href="http://hinchcliffe.org/archive/2008/02/27/16617.aspx?ref=christoffer.soop.ch" title="Web Oriented Architecture">WOA</a> for Web Oriented Architecture. WOA can be seen as a more constrained version of SOA.</em></p>
<p><em>It has even been suggested that REST is useful within applications. How this can be done is described in <a href="http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart1&amp;ref=christoffer.soop.ch" title="A Restful Core">four articles</a> on <a href="http://www.theserverside.com/?ref=christoffer.soop.ch" title="The Server Side">The Server Side</a>. Beware though, although well written they end up being a plug for <a href="http://1060.org/?ref=christoffer.soop.ch" title="1060 Net Kernel">NetKernel</a>, a REST-ful application server built on something they call ROC &#x2013; Resource Oriented Computing. I would say the jury is still out on question whether using REST internally in an application is a good alternative or not.</em></p>
<p><em><strong>References</strong></em></p>
<p><em>Wikipedia has a well written article on REST:</em></p>
<p><em><a href="http://en.wikipedia.org/wiki/REST?ref=christoffer.soop.ch" title="Wikipedia on REST">http://en.wikipedia.org/wiki/REST</a></em></p>
<p><em>Web Oriented Architecture</em></p>
<p>*<a href="http://hinchcliffe.org/archive/2008/02/27/16617.aspx?ref=christoffer.soop.ch" title="What is WOA?">http://hinchcliffe.org/archive/2008/02/27/16617.aspx</a><br>
*</p>
<p>*The Server Side, A Restful Core:<br>
*</p>
<p><em><a href="http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart1&amp;ref=christoffer.soop.ch" title="A Restful Core, part 1">http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart1</a> <a href="http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart2&amp;ref=christoffer.soop.ch" title="A Restful Core, part 2"></a></em></p>
<p><a href="http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart2&amp;ref=christoffer.soop.ch">http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart2</a></p>
<p><a href="http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart3&amp;ref=christoffer.soop.ch" title="A Restful Core, part 3">http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart3</a><br>
<a href="http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart3&amp;ref=christoffer.soop.ch" title="A Restful Core, part 4">http://www.theserverside.com/tt/articles/article.tss?l=ARESTfulCorePart4</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[SOA is Dead (but the corpse is still kicking)]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>In a famous post from January this year (which I missed) Ann Thomas Manes declares SOA dead. She is a Reasearch Director within the Burton Group, has worked with SOA in the Burton Group and elsewhere, and is a co-author of the WS-* specifications.</p>
<p>The post has sparked fierce defense</p>]]></description><link>https://christoffer.soop.ch/soa-is-dead-but-the-corpse-is-still-kicking/</link><guid isPermaLink="false">645818765c4dcc000153cb58</guid><category><![CDATA[Architecture]]></category><category><![CDATA[REST]]></category><category><![CDATA[SOA]]></category><category><![CDATA[WOA]]></category><dc:creator><![CDATA[Christoffer Soop]]></dc:creator><pubDate>Thu, 23 Apr 2009 11:03:06 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>In a famous post from January this year (which I missed) Ann Thomas Manes declares SOA dead. She is a Reasearch Director within the Burton Group, has worked with SOA in the Burton Group and elsewhere, and is a co-author of the WS-* specifications.</p>
<p>The post has sparked fierce defense from vendors like Oracle. During the half day <a href="http://www.oracle.com/webapps/events/EventsDetail.jsp?p_eventId=90347&amp;src=6640143&amp;src=6640143&amp;Act=575&amp;ref=christoffer.soop.ch">SOA Architect forum in Geneva</a> this Tuesday, Oracle spent the first seminar repeating that &#x201C;SOA is not dead&#x201D; like a mantra, I guess in order to reinforce the message. It seemed to be one of the mayor points they wanted to get across.</p>
<p>Excerpt from Ann Thomas Manes post <a href="http://apsblog.burtongroup.com/2009/01/soa-is-dead-long-live-services.html?ref=christoffer.soop.ch">SOA is Dead; Long Live Services</a></p>
<blockquote>
<p>Successful SOA (i.e., application re-architecture) requires disruption to the status quo. SOA is not simply a matter of deploying new technology and building service interfaces to existing applications; it requires redesign of the application portfolio. And it requires a massive shift in the way IT operates. The small select group of organizations that has seen spectacular gains from SOA did so by treating it as an agent of transformation. In each of these success stories, SOA was just one aspect of the transformation effort. And here&#x2019;s the secret to success: SOA needs to be part of something bigger. If it isn&#x2019;t, then you need to ask yourself why you&#x2019;ve been doing it.</p>
<p>The latest shiny new technology will not make things better. Incremental integration projects will not lead to significantly reduced costs and increased agility. If you want spectacular gains, then you need to make a spectacular commitment to change. Like Bechtel. It&#x2019;s interesting that the Bechtel story doesn&#x2019;t even use the term &#x201C;SOA&#x201D;&#x2014;it just talks about services.</p>
<p>And that&#x2019;s where we need to concentrate from this point forward: Services.</p>
</blockquote>
<p>This falls in line with my understanding that SOA without BPR/BPM/Transformation really does not amount to much. You need the entire organization to support a process and service view on business and IT in order to see real benefit.</p>
<p>In another post <a href="http://broadcast.oreilly.com/2009/01/soa-is-dead-its-about-time.html?ref=christoffer.soop.ch">SOA is Dead? It&#x2019;s About Time</a> by Kurt Cagle acknowledges Ann Thomas Manes view but complements the picture with adding that</p>
<blockquote>
<p>Perhaps my biggest reservation about SOA had to be the fact that, at the end of the day, it was still an RPC model that concentrated primarily on calling APIs that differed from one provider to the next. The result of this thinking is the sea of APIs, where there are now tens of thousands of APIs, each of which doing things a little (or in some cases, a lot) differently from one another, with very little cohesion, and with little thought to the semantic complexity that comes when you have that many microlanguages all competing for programmer attention.</p>
<p>Purists may argue that over time the SOA model (especially the SOAP/WSDL model) had been moving towards a more messaging-oriented architecture, but I&#x2019;d counter that all that a messaging queue does is to decouple the receipt of the message from the response &#x2013; if the message processor invokes a service, it is still an RPC, especially when transactions are involved.</p>
<p>This is one of the reasons that I think that resource oriented services &#x2013; RESTful services &#x2013; are beginning to gain real traction even as the big-box SOA projects are falling to the accountant&#x2019;s axe. The publish/subscribe model in which what you&#x2019;re publishing are not blogs but data documents (think XBRL or HL7) performs the same type of decoupling that message-oriented SOA did, but completely abstracts the intent from the process of communication.</p>
</blockquote>
<p>This is consistent with my view that SOA, which if done correctly, should be document or data driven and should rely on messaging. As an alternative to an ESB used mainly for RPC over SOAP Web Services, I think that an REST-ful approach should be seriously considered when attempting SOA. Some thinkers at Gartner have started talking about a WOA &#x2013; Web Oriented Architecture &#x2013; as further constrained subset of the SOA approach based on REST principles.</p>
<p>I believe the change will be heavily resisted by companies like Oracle and IBM since there is less money to be made on the simpler and less tool/platform-intensive REST-ful approach to enterprise computing. Also they all have invested heavily in the WS-* and RPC-style SOA corner and thus are reluctant to change. But change will come sooner or later and the ongoing economical crisis will be a strong driver.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>