<?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>Technology of Content &#187; REST</title>
	<atom:link href="http://blog.technologyofcontent.com/category/rest/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.technologyofcontent.com</link>
	<description>Ramblings on the technology of content management</description>
	<lastBuildDate>Sun, 25 Apr 2010 21:45:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Smart resources, or why you should care about HTTP PATCH</title>
		<link>http://blog.technologyofcontent.com/2009/12/smart-resources-or-why-you-should-care-about-http-patch/</link>
		<comments>http://blog.technologyofcontent.com/2009/12/smart-resources-or-why-you-should-care-about-http-patch/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 23:42:06 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[PATCH]]></category>

		<guid isPermaLink="false">http://blog.technologyofcontent.com/?p=169</guid>
		<description><![CDATA[Unusually, there has been a significant change to the HTTP protocol this week. The PATCH method was approved by the IETF.

This is a big change as one of the parts of the HTTP model is the small &#8220;uniform interface&#8221;, where there are very few things you can do to web resources. GET is the most [...]]]></description>
			<content:encoded><![CDATA[<p>Unusually, there has been a significant change to the HTTP protocol this week. The <a href="http://greenbytes.de/tech/webdav/draft-dusseault-http-patch-16.html">PATCH method</a> was approved by the <a href="https://datatracker.ietf.org/drafts/draft-dusseault-http-patch/">IETF</a>.</p>

<p>This is a big change as one of the parts of the HTTP model is the small &#8220;uniform interface&#8221;, where there are very few things you can do to web resources. GET is the most common, to retrieve a resource representation. Then there is PUT to update a resource, and DELETE to delete it. Then there is POST, which tends to cover everything else you might want to do. The problem with that is that discovering the interface for POST is difficult, as is knowing exactly what it will do. (There are a few other verbs too).</p>

<p>PATCH is much more straightforward. PUT updates an entire resource with a new version, while PATCH just makes an amendment to a resource. For some types of resource, the entire resource may be large, so that just sending differences will save bandwidth. Also, sending the full resource may unnecessarily make the changes sequential, for example append operations where the order of the operations is not significant. One example given is a log file, where many processes  may be adding entries, and if they had to retrieve the whole log, append a new entry and write it back there would be a lot of extra traffic, and a chance of either lost updates or processes having to retry if the resource was modified during this process. Clearly a PATCH operation here that does an append would make sense. I am not sure that is actually a very good example though, as you would  almost certainly create a resource for each log entry, rather than one for the whole lot, but clearly other similar patterns exist.</p>

<h2>HTTP is not a filesystem</h2>

<p>When it was new, people tended to treat HTTP like a filesystem. After all that was the common model for storage, and web servers generally stored web pages as files, so they tended to e treated much like that, with filename extensions annd index files, and WEBDAV was created to try to make the web usable as a filesystem protocol. This model does not really work very well however, as it does not model the things you can and can&#8217;t do with HTTP. The methods are one example; updating entire resources at once means they tend to be small units, rather than, for example, log files. File systems generally struggle to store millions of tiny files without wasting a lot of space, and without becoming slower. The web  resource does not have to support full Unix filesystem semantics (a topic that oddly Wikipedia seems to be missing an entry on! May have to rectify that), and supports a much simpler updte model.</p>

<p>Maybe the easist way of thinking about HTTP is to see every URL is a small <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">Model View Controller</a> (MVC) system. The model is an abstract resource, which we can see through GET, which retieves views. There can be multiple views, as a request can ask for different media types and encodings for a single resource. The controllers are the media types supported by PUT, which are usually the same as those for GET, but need not be; because both the view and the controller need to represent the whole resource state, they do tend to be quite complex representations, such as XML documents. PATCH however is also a controller, but a more interesting one in many ways, as it can send just state changes to the model, which tends to be how many MVC systems work.</p>

<p>Another thing that PATCH enables is resources that hide some of their state. A resource could only support PATCH and not PUT so that state modifications were only changes. If the state returned by GET is not the complete state, the resource could hide parts of the model. An example could be a voting method that records but does not reveal who has voted, only returning totals, which accepts votes as PATCH requests.</p>

<h2>Server side scripting</h2>

<p>One PATCH format that makes a lot of sense is actually to use executable code, rather than say diff files. There is no reason why you  should not send the server a PATCH request that is some Javascript to modify the DOM of an HTML resource which can be executed serverside, or an XSL transform to modify and XML object. Sending code is an efficient way of making changes to a resource, and can be executed in a sandbox like the browser sandbox. This will be another driving factor for Javascript on the server side, as it is well suited for embedding like this, and already has a DOM model for transforms.</p>

<p>All these changes take us further away from the filesystem model. Web resources will more and more combine some storage with some computation, including ability to execute code in a contolled way. Smart resources will become more common, over dumb storage only resources.</p>

<h2>In other news</h2>

<p>Next in line for HTTP, hopefully, is the <a href="http://tools.ietf.org/html/draft-nottingham-http-link-header-06">Link header</a> which adds a new header for legacy document formats that do not include a native hyperlinking capability. This will allow relationships between these documents to be included in the retrieved resource, such as a link to metadata or other related resources. The HTTP replacement for the file system model is getting serious.</p>

<!--a href="http://geekandpoke.typepad.com/geekandpoke/2009/11/service-calling-made-easy-part-1.htm"><img src="http://geekandpoke.typepad.com/.a/6a00d8341d3df553ef012875f312f9970c-pi" width="400"/></a-->
]]></content:encoded>
			<wfw:commentRss>http://blog.technologyofcontent.com/2009/12/smart-resources-or-why-you-should-care-about-http-patch/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Search APIs with HTTP interfaces</title>
		<link>http://blog.technologyofcontent.com/2009/11/search-apis-with-http-interfaces/</link>
		<comments>http://blog.technologyofcontent.com/2009/11/search-apis-with-http-interfaces/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 22:45:55 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[API]]></category>

		<guid isPermaLink="false">http://blog.technologyofcontent.com/?p=156</guid>
		<description><![CDATA[I had a brief exchange with Erik Wilde or @dret on twitter about REST and query languages; specifically SPARQL and whether the SPARQL DESCRIBE could be made RESTful with GET and PUT.

SPARQL DESCRIBE is a somewhat controversial feature of SPARQL that returns an RDF graph &#8220;around&#8221; the query, including all the referenced URIs and some [...]]]></description>
			<content:encoded><![CDATA[<p>I had a brief exchange with Erik Wilde or <a href="http://twitter.com/dret">@dret</a> on twitter about REST and query languages; specifically SPARQL and whether the SPARQL DESCRIBE could be made RESTful with GET and PUT.</p>

<p>SPARQL DESCRIBE is a <a href="http://www.w3.org/2001/sw/DataAccess/ftf4.html#item14">somewhat controversial</a> feature of SPARQL that returns an RDF graph &#8220;around&#8221; the query, including all the referenced URIs and some sort of domain specific context. It is less well defined than CONSTRUCT, that also extracts a graph.</p>

<p>But there are not many guidelines for how to actually write useful interfaces for search type functionality for REST web service APIs.</p>

<p>A lot of this applies to other collection type interfaces, collection in the Atom sense, which is essentially a predefined filter rather than one you can submit a query to. Resource collections are a fundamental feature of any real world system, being able to take a set of resources and manipulate it as one. Query languages are generally an efficient way of defining interesting collections.</p>

<p>I do not specifically refer to SPARQL here. Like many of the W3C recommendations, it is XML document oriented in its specification, not HTTP oriented, and so does not try to address the types of issues here. I have some issues with the W3C approach, sidestepping implementation issues; indeed the whole RDF as Prolog wrapped in XML does not seem very productive, and I think a more pragmatic approach from practise will work better, as with some of the other W3C initiatives. Items like DESCRIBE imply much more domain knowledge, and it is unclear what interoperability would mean.</p>

<h2>Whats the problem with query languages and REST?</h2>

<p>The main issues are that a SQL style SELECT should map to an HTTP GET, but instead we are passing a query with another verb in it. One method of avoiding this would be to work with predefined refinement &#8220;queries&#8221; where you could walk through paths of filters from a resource that represents everything. Imagine a faceted navigation system drilling down to construct what becomes a filter query through a selection of refine links (where you might end up with a hierarchical URL in the end not a query document). This might work better in a system with a finite vocabulary, although it could still be navigated via forms potentially. However this starts to work less well with complex nested queries with sorting and limits, and subterms, as the number of opotions is large, and it would be complex to make a comprehensive set of link types to make them understandable (you might just end up tokenizing SQL in links which does not seem elegant).</p>

<h2>REST search and GET queries</h2>

<p>First off, for standard read only GET queries, there is one model that is really useful and is too rarely used. For some reason most search queries in &#8220;REST&#8221; frameworks involve submitting a query as a POST request because the query string would be too long for a GET request. This however generally does not create a resource, it just returns a response, or a temporary response resource. CMIS for example works along these lines. However the sane model along these lines is to submit a query document with POST (or PUT) and have it persistent until DELETEd, and be able to requery as needed. Also, it should be possible to create query resources with unbound variables, which can be used by a system like prepared queries in SQL databases; in particular the creation of these should allow a system to work out perhaps if it needs additional indexes based on the queries that have been created. These can then be evaluated by using query strings to bind the parameters. For some reason you rarely if ever see a query specification for a REST API that has unbound variables in the query, thus missing out on the ability to use this pattern.</p>

<p>Note that the query itself is a resource, so we can for example DELETE the prepared query eg http://example.com/query. There are also resources corresponding to the result sets eg http://example/com/query?q=red.</p>

<p>As well as unbound variables for constants, another missing feature from most query languages (probably because they were not designed for HTTP transport) is the lack of ability to specify a URL that corresponds to a subexpression. This can be considered as another extension of unbound variables; you can also see this as the extension of the labguage to support SQL style views that can themselves be queried. Like a view, you could either use the definition or the current materialized version for performing further queries.</p>

<h2>REST and update queries</h2>

<p>Although it rarely seems to be done, there is no particular reason that once you have a query resource like the ones defined above, you should not be able to DELETE http://example/com/query?q=red to delete all red objects, or PUT a new set of red objects to replace the existing ones. Most collection oriented protocols, such as Atom, do not allow PUT and DELETE methods on collections, only on the member resources. POST is allowed in Atom, to define collection membership; this only makes sense where collection membership cannot be defined by visible properties of a resource; the instruction create this item with whatever properties are needed to put this item in this query result is not necessarily something that works for any domain. Certainly one can think of models in which allowing PUT and DELETE on search results resources would be useful, although there might be issues with paging and large document sizes on some types of resource. PATCH would be a useful addition for doing the equivalent of SQL UPDATE, in order to reduce the document sizes, rather than having to PUT back everything.</p>

<p>There may be other domain issues, and in some systems consistency issues with mass deletion and insertion that mean that actions on individual items not collections are more efficient of course, but extending the uniform HTTP interface to collections should certainly not be ruled out for many domains.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technologyofcontent.com/2009/11/search-apis-with-http-interfaces/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RESTful daydream #4</title>
		<link>http://blog.technologyofcontent.com/2009/10/restful-daydream-4/</link>
		<comments>http://blog.technologyofcontent.com/2009/10/restful-daydream-4/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 15:34:41 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[CMIS]]></category>
		<category><![CDATA[jcr]]></category>

		<guid isPermaLink="false">http://blog.technologyofcontent.com/?p=110</guid>
		<description><![CDATA[In favour of a REST architecture for a web content repository]]></description>
			<content:encoded><![CDATA[<p>This blog post has gone through far too many iterations, and taken far too long to write! It got much shorter in the process though.</p>

<p>It started with an idea I had, in an innocent sort of way. I thought if I looked at the JCR specs for a bit I might find some kind of way of building a non Java interface with them. You know, maybe there might be a nice REST architecture waiting to get out. But of course there is no such thing. It is an application definition. There are not even that many ways of implementing it, other than choosing your object persistence method to be a database, file, or something else.</p>

<p>The REST architecture is notionally provided by another layer, such as Apache Sling, but Sling is in no way a REST layer, it is a URL dispatcher and scripting and application layer with which some REST style applications can be developed. With that you end up with a pretty heavyweight development framework, indeed together you have much of Day&#8217;s CMS offering in effect, rather than a lightweight REST repository solution.</p>

<p>I had a look at CMIS again. Fielding once <a href="http://roy.gbiv.com/untangled/2008/no-rest-in-cmis">laid into CMIS for not being REST</a> and you can see why, although some improvements have been made since that. Although resources are discoverable through hypertext, there is a fair amount of semantics that needs to be known to understand what a type or a checkout means, and the search queries are obviously just RPC wrappers. It is not too bad though, but unfortunately the data model does not map well onto web content management right now for obvious historical document management reasons. Fixable? I think it serves a part‎icular purpose well and should probably not be forced into anything else, as we need it to succeed in its field.</p>

<p>Day claims that JCR is <a href="http://dev.day.com/microsling/content/blogs/main/fudbusting2.html">not a Java standard</a> in an odd way, that you can implement the API in another language. Thats a strange argument to make, especially as the types are defined as Java types, and standards without interoperability are pretty vague. Without some sort of wire format or ABI this is meaningless outside the JVM world. People are making <a href="http://www.simpcore.org/">JCR like repositories in PHP</a> but outside any standards process, so in the end this just becomes a PHP repository project; Typo3 seems to be building another, also closely aligned to JCR.</p>

<p>The problem with these efforts is that it is not helping the balkanization of web CMS, which is already fragmented by language and API, which is ridiculous in an industry that is about the web. The web has an architecture (REST) and an API (HTTP). Building web content management on Java APIs or PHP APIs or .NET is a legacy way of thinking; it is acceptable for document management given its role in existing enterprise architectures, but it is not going to work if we want to get widespread acceptance in web development; in the short term it is the easy path, it is what people are used to, but a forward thinking industry needs to look at defragmenting the landscape and building future proof tools.</p>

<p>The odd thing is that a web content repository alone surely lends itself to a simple REST architecture. Content is after all lots of small resources with relations. Hypertext. It is pretty much in presentation a fairly dumb web application, although with a fair amount going on behind the scenes. It takes content, relates it to other content, and serves it back, with authentication and versioning. Everything else is in other system layers, transforming it and so on. Not simple, but well defined; lower level than JCR + Sling say</p>

<p>So we need to work on a web content repository model, as a community. Process wise, it makes sense for this to sit in an organization like AIIM, as a content management based industry body. It may well be that what ends up coming out of this is more standardized architectures and semantics and open source implementations rather than the tighter prescriptions of JCR and CMIS; I have some ideas along these lines that I need to code up. I have had some discussions and there is a degree of interest in some sort of solution; who is interested? Or is infrastructure dead, everything ust wants interfaces?</p>

<p><a href="http://dilbert.com/strips/comic/2009-09-02/" title="Dilbert.com"><img src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/60000/6000/400/66480/66480.strip.gif" width="480" alt="Dilbert.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technologyofcontent.com/2009/10/restful-daydream-4/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>The resource oriented enterprise followups</title>
		<link>http://blog.technologyofcontent.com/2009/08/the-resource-oriented-enterprise-followups/</link>
		<comments>http://blog.technologyofcontent.com/2009/08/the-resource-oriented-enterprise-followups/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 16:08:31 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://blog.technologyofcontent.com/?p=84</guid>
		<description><![CDATA[Followups after my first post on the resource oriented enterprise.]]></description>
			<content:encoded><![CDATA[<p><em>This is a followup to my earlier post on <a href="http://blog.technologyofcontent.com/2009/08/the-resource-oriented-enterprise/">the resource oriented enterprise</a>, I had some good feedback much from the <a href="http://tech.groups.yahoo.com/group/rest-discuss">REST mailing list</a> which I summarize here. As I said there this is an attempt to get some of these ideas documented as they largely seem to be invisible.</em></p>

<blockquote>
  <p>Only solutions that produce partial results when partially implemented can succeed. The network is littered with ideas that would have worked had everybody adopted them. Evolvable systems begin partially working right away and then grow, rather than needing to be perfected and frozen. <a href="http://www.shirky.com/writings/evolve.html">Clay Shirky</a></p>
</blockquote>

<p>I came across that quote from Clay Shirky as I was writing this which seemed very relevant.</p>

<p><a href="http://www.jalgermissen.com/">Jan Algermissen</a> added the two following very good points:</p>

<blockquote>
  <p>the use of REST brings the decentralization aspects of the Web into the enterprise world and allows designers and developers of networked systems to create and evolve their components without the resource and time consuming effort of bringing them into a single room to discuss APIs. In geographically distributed organizations this might sometimes even be impossible.</p>
  
  <p>the use of REST facilitates fragmented change. It deliberately provides room for evolution (e.g. format extensions) that can bypass the main organizational control. Evolutions that turn out to be valuable can flow back into the main line while others silently die. No harm to ongoing communication between systems is done by either of those.</p>
</blockquote>

<p>These are really very important points. You cannot really undersell the success of the web, and the web took off with its own architecture despite attempts to force other architectures on it. The decentralization and the ability to reuse and mashup services to make new things is part of that architecture. The idea of introducing REST to the enterprise is to help the enterprise leverage the agility of the web architecture, and to make building new enterprise applications cheaper and easier.</p>

<p><a href="http://soundadvice.id.au/blog/">Benjamin Carlyle</a> made the good point that you can view REST as an evolution of SOA, as better easier to consume services. This does not quite fit with my view of history, but I do agree that it is a good way to sell it now as &#8220;SOA on steroids&#8221; as he says. He linked to useful sounding book coming out later this year on <a href="http://soabooks.com/book.asp?book=soa_rest&amp;page=overview">SOA and REST</a>. He examines seven SOA objectives from Thomas Erl&#8217;s book, Principles of Service Design:</p>

<ol>
<li><p>Increased Intrinsic Interoperability</p>

<p>Made better with a uniform interface &#8211; Interoperability stops being an &#8220;easy to plug together at design time&#8221; thing to &#8220;easy to plug together at run-time&#8221;</p></li>
<li><p>Increased Federation</p>

<p>This is not an explicit target of REST, to get everyone using the same service. However, it is compatible with REST. It also occurs in practice on the Web through market forces.</p>

<p>While SOA emphasises reuse of services, REST emphasises reuse of components (including services), media types, and connectors.</p></li>
<li><p>Increased Vendor Diversity Options</p>

<p>More or less the same for SOA and REST, however REST is probably still less mature in the enterprise space. Time will change this.</p></li>
<li><p>Increased Business and Technology Alignment</p>

<p>ie, we build services that the business wants, and can change in pace with business objectives</p>

<p>Again REST doesn&#8217;t particularly target specific valuable services, but is compatible with the notion</p>

<p>REST is more capable of incremental upgrade than a classical SOA, especially &#8220;dynamic evolution&#8221;.</p></li>
<li><p>Increased ROI</p>

<p>Classically realised in SOA by reuse of services, which again is compatible with REST</p>

<p>Again, a uniform interface produces wins on this front when compared to classical SOA</p></li>
<li><p>Increased Organizational Agility</p>

<p>Classically realised by being able to build new applications quickly by reusing existing services</p>

<p>Again, compatible with REST and again a uniform interface produces improved performance</p></li>
<li><p>Reduced IT Burden</p>

<p>Few legacy systems doing more means less maintenance and related support activities &#8211; again compatible with REST.</p>

<p>REST makes maintenance easier with its focus on dynamic evolvability</p></li>
</ol>

<p><a href="http://www.bizcoder.com/">Darrel Miller</a> has obviously been through some maintenance pain. The web architecture was always designed to not have centralization, and that obviously mean that things are incrementally upgradeable.</p>

<blockquote>
  <p>For me the business case for REST is around client/server coupling and maintenance effort. My experiences with SOAP API&#8217;s on the Microsoft platform were that if you sneezed on the server API that defined the contract you had to recompile and redeploy the clients. And then there is versioning. In the WCF world versioning is a potential nightmare, with changing URLs, XML namespaces on service contracts, message contracts and data contracts.</p>
  
  <p>I believe that REST&#8217;s use of hypermedia and conneg make maintenance, deployment and versioning much easier, which translates to lower costs to the business in the maintenance phase of an application.</p>
</blockquote>

<p><a href="http://bill.burkecentral.com/">Bill Burke</a> responded to Darrel saying how he has been using it.</p>

<blockquote>
  <p>Also, I think interoperability is much easier to achieve with REST because the ubiquity of HTTP. This has a huge positive side-effect for integration as well. My gut tells me that SOA Governance could really reap the benefits of a RESTful architecture as well, but I don&#8217;t have any details yet on how.</p>
  
  <p>All this plus Darrel&#8217;s comment on the fragility of SOAP stacks sold me on the idea of REST which is why I&#8217;ve been really pushing it hard at Red Hat and all our middleware projects.</p>
</blockquote>

<p>A very useful set of responses, thanks to everyone. Will be writing more on this soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technologyofcontent.com/2009/08/the-resource-oriented-enterprise-followups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Resource Oriented Enterprise</title>
		<link>http://blog.technologyofcontent.com/2009/08/the-resource-oriented-enterprise/</link>
		<comments>http://blog.technologyofcontent.com/2009/08/the-resource-oriented-enterprise/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 20:40:58 +0000</pubDate>
		<dc:creator>justin</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[ROA]]></category>
		<category><![CDATA[ROE]]></category>

		<guid isPermaLink="false">http://blog.technologyofcontent.com/?p=49</guid>
		<description><![CDATA[This is the start of getting a bunch of ideas about how web technologies are going to change the way business works and enterprise software is built. I have been meaning to start writing this up for a while. Here is an initial overview, somewhere to start... follow up post soon.]]></description>
			<content:encoded><![CDATA[<p><em>This is the start of getting a bunch of ideas about how web technologies are going to change the way business works and enterprise software is built. I have been meaning to start writing this up for a while. Here is an initial overview, somewhere to start&#8230; Some of these ideas are floating around <a href="http://www.restfulness.info/">elsewhere</a> it seems, from web practitioners working in the enterprise, but there is surprisingly little written up so far.</em></p>

<p>I went to a  meeting a while back with a company starting to move to a web service based, internal API based architecture, and there was a minute where the CTO said (more or less) &#8220;does anyone know of any let or hindrance to this being a SOAP API?&#8221;. Like those moments at weddings, no one spoke out. But I do object. SOAP is not the backbone of a happy architecture, but we do not have the strength to say no right now.</p>

<p>So here is the beginning of the shout out. The enterprise architecture needs to be a resource oriented architecture (ROA) not a service oriented architecture (SOA). The enterprise needs to move from SOAP to REST.</p>

<p>Web developers know this. When given the choice, <a href="http://www.oreillynet.com/pub/wlg/3005">9 out of 20 cats prefer to use REST</a>. It is more productive. It does not involve programs to generate huge chunks of useless code. It involves hypertext (HATEOS) not opaque documents that are mappings of database schemas.</p>

<p>What are the resources in the enterprise? Start with customers. A CRM system is a clear example of something that needs to be modeled as resources. You need API calls that can find products a customer has bought, support tickets, all the core data that you would need to build customer service portals, internal support applications. What is your customer API?</p>

<p>Building this framework can be incremental. You need either tools that already provide REST APIs, which is becoming easier, or a web application development framework. This is the convergence point between application frameworks and web content management. The big issues are the domination of legacy applications with bolt on APIs that may have moved from SQL to CORBA to SOAP over the years. You can however build a REST API over at least parts of these applications to open them up into the enterprise.</p>

<p>OK thats the beginning. Apart from cheaper application development where is the real value?</p>

<p>Resources are the first part of the REST architecture, and resources are much easier to work with than services, as they share uniform semantics, and they are addressable, two keys to making application design simple. The big bit though is the (harder to understand) HATEOS, Hypertext as the Engine of Application State. What this involves is moving the vague and very expensive field of business logic from code (often code that is not even owned or understood by the enterprise, as it has been embodied into code written into systems from suppliers) into hypertext documents.</p>

<p>A concrete example might help here, based on another recent consulting example. A professional body has a set of different membership levels, exams, rules, CPD requirements and so on. These are resources, described states, and hypertext links of state transitions. This is the core of the business logic of the organization, embodied in documents. It can be used to build the membership application, as it describes for example the actions open to a member at the present time, as well as providing potentially a browsable structure, as well as a formal structure that can be used to ask questions about membership (what are the routes to becoming X, for example).</p>

<p>You can view this as a move of business logic to a declarative rather than imperative form. Things do not have to be stored in documents in the underlying storage, although the interface is document and hypertext based. Hypertext makes things human browsable, and declarative makes them computer browsable, and HATEOS makes them discoverable. Business logic becomes content rather than data, rather than there being tables of parameters that the business logic black box feeds off, the states themselves become resources that can be discovered, addressed, and reasoned with.</p>

<p>As states become resources in a REST model, because of the statelessness of web applications, both states and state transitions become first class objects. Constructing ad-hoc queries about state changes should become easy (what percentage of customers renew their contracts, say). The first class objects need to be the ones that are meaningful for the business.</p>

<p><em>There is more to this, it needs expanding. Perhaps we need a manifesto. The software architecture of the web is going to make huge changes to the architecture of other realms, more than most people realize it seems. It is inevitable as things get re-architected around the web that more areas will be affected; also there are the benefits of scalability and reliability that are being created for the web. If anyone has any other business case references for REST please post in comments.</em></p>

<p><a href="http://www.dmst.aueb.gr/dds/etech/arch/rom.png"><img src="http://www.dmst.aueb.gr/dds/etech/arch/rom.png" width="450px"/></a></p>

<p>(Image from <a href="http://www.dmst.aueb.gr/dds/etech/arch/indexw.htm">this software architecture overview</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technologyofcontent.com/2009/08/the-resource-oriented-enterprise/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
