<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: REST and Loose Coupling</title>
	<atom:link href="http://www.subbu.org/blog/2007/12/rest-and-loose-coupling/feed" rel="self" type="application/rss+xml" />
	<link>http://www.subbu.org/blog/2007/12/rest-and-loose-coupling</link>
	<description>HTTP, REST and some Cycling</description>
	<lastBuildDate>Wed, 21 Jul 2010 08:57:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Subbu Allamaraju</title>
		<link>http://www.subbu.org/blog/2007/12/rest-and-loose-coupling/comment-page-1#comment-195</link>
		<dc:creator>Subbu Allamaraju</dc:creator>
		<pubDate>Wed, 26 Dec 2007 11:57:47 +0000</pubDate>
		<guid isPermaLink="false">http://wp.subbu.org/2007/12/rest-and-loose-coupling/#comment-195</guid>
		<description>Hi JJ - very interesting discussion :)

&quot;Now, you are showing another strong coupling that works well on the Web and does not work at all in the &quot;information system&#039;s world&quot;. Since REST couples application state with Resource (representations) and Identity with Location (access), what happens in the event that I am a consumer of a resource and you change the version on me? There is only one resource right? As a consumer I hold a URI to this resource to be able to do something with it at a later time. What happens to the resource after the version upgrade? I can&#039;t access it any longer? how do I get the new URI?&quot;

I don&#039;t think there is a magic solution to this problem with any kind of networked architecture. Think of a WSDL changing the interface. For compat sake, the WSDL may include both the old and new versions, but that does not do any good to the machine client. The machine client will continue to use the version that it understands. The same is the case with REST. A machine client will continue to ignore the new URI. This is not coupling.
</description>
		<content:encoded><![CDATA[<p>Hi JJ &#8211; very interesting discussion :)</p>
<p>&#8220;Now, you are showing another strong coupling that works well on the Web and does not work at all in the &#8220;information system&#8217;s world&#8221;. Since REST couples application state with Resource (representations) and Identity with Location (access), what happens in the event that I am a consumer of a resource and you change the version on me? There is only one resource right? As a consumer I hold a URI to this resource to be able to do something with it at a later time. What happens to the resource after the version upgrade? I can&#8217;t access it any longer? how do I get the new URI?&#8221;</p>
<p>I don&#8217;t think there is a magic solution to this problem with any kind of networked architecture. Think of a WSDL changing the interface. For compat sake, the WSDL may include both the old and new versions, but that does not do any good to the machine client. The machine client will continue to use the version that it understands. The same is the case with REST. A machine client will continue to ignore the new URI. This is not coupling.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Jacques Dubray</title>
		<link>http://www.subbu.org/blog/2007/12/rest-and-loose-coupling/comment-page-1#comment-194</link>
		<dc:creator>Jean-Jacques Dubray</dc:creator>
		<pubDate>Wed, 26 Dec 2007 06:26:02 +0000</pubDate>
		<guid isPermaLink="false">http://wp.subbu.org/2007/12/rest-and-loose-coupling/#comment-194</guid>
		<description>Subbu:

thanks for these precisions. I read your posts on web service versioning and it looks like we are pretty much in line with the approach there.

I am a bit skeptical about what you say about REST:

&gt;&gt; b. Change encoding formats (xml, json, query params etc.) such that they are forwards/backwards compatible.
No problem here since it is the same recommendation as WS

&gt;&gt; a. Provide a different set of URIs for each version for major (I mean really MAJOR) changes that are incompatible with the current version

Now, you are showing another strong coupling that works well on the Web and does not work at all in the &quot;information system&#039;s world&quot;. Since REST couples application state with Resource (representations) and Identity with Location (access), what happens in the event that I am a consumer of a resource and you change the version on me? There is only one resource right? As a consumer I hold a URI to this resource to be able to do something with it at a later time. What happens to the resource after the version upgrade? I can&#039;t access it any longer? how do I get the new URI?

See the business logic changes constantly, at least its lifecycle is in general shorter than the one of the resources it manages. So coupling the &quot;interface&quot; to the &quot;resource&quot; is a bad, very bad idea. Again, it works well when a user is in the loop because the user never keeps application state, when you navigate away from the resource representation there is no &quot;real&quot; application state left on your browser. In information systems architecture this assumption simply does not hold. When a resource interacts with another resource they keep a knowledge of their respective states (could just be implicit) and this is necessary to understand what inter-action comes next. You can never push all the state of the inter-action to a common location. You can have a shared state, for sure, though it is not required, but you can never pushed the application state outside the resource itself, because resources have an intrinsic state machine on which the unit of work (the application) they are currently involved in relies upon. Most often (99% of the time) you never want to share all your state as part of the interactions.

What you are telling us is that a different URI will point to a different code base? how can you be sure you are talking about the same resource. Identity is now mixed with Version of the action interface to the resource (not the resource itself). That does not sound like a good design if you ask me.

At the end of the day, the RESTifarians come in as if Information Systems are a brand new thing and we are still discovering some of their core features. In case you have not noticed, information systems were invented 8000 years ago, yes, 8000 years ago, in the middle-east. They brought us civilization, writing, with writing, knowledge, education (word of mouth does not scale), science, philosophy... The characteristics of information systems are independent of &quot;computing&quot;. The killer app for computers in the 50s was &quot;data processing&quot;, it is only in the 70s with &quot;permanent storage&quot; and &quot;online&quot; access were invented that information systems started to be hosted entirely within a computer and computers did not just &quot;compute&quot; anymore.

Unfortunately, most people don&#039;t realize that computing is different from managing information. They mix up pretty much everything: data, middleware, algorithms, programming languages, query languages... recently there was even a guy who commented on SimpleDB and started to argue that Data was not &quot;relational&quot;.  Guys, I have news for you. The principles of information systems have not changed for pretty much 8000 years: things like identity, content, states, representations, actions, inter-actions, trans-actions, privacy, signature, &quot;relationality&quot; of data, indexes... are still the same. The technology has changed but not the principles.

JJ-
</description>
		<content:encoded><![CDATA[<p>Subbu:</p>
<p>thanks for these precisions. I read your posts on web service versioning and it looks like we are pretty much in line with the approach there.</p>
<p>I am a bit skeptical about what you say about REST:</p>
<p>>> b. Change encoding formats (xml, json, query params etc.) such that they are forwards/backwards compatible.<br />
No problem here since it is the same recommendation as WS</p>
<p>>> a. Provide a different set of URIs for each version for major (I mean really MAJOR) changes that are incompatible with the current version</p>
<p>Now, you are showing another strong coupling that works well on the Web and does not work at all in the &#8220;information system&#8217;s world&#8221;. Since REST couples application state with Resource (representations) and Identity with Location (access), what happens in the event that I am a consumer of a resource and you change the version on me? There is only one resource right? As a consumer I hold a URI to this resource to be able to do something with it at a later time. What happens to the resource after the version upgrade? I can&#8217;t access it any longer? how do I get the new URI?</p>
<p>See the business logic changes constantly, at least its lifecycle is in general shorter than the one of the resources it manages. So coupling the &#8220;interface&#8221; to the &#8220;resource&#8221; is a bad, very bad idea. Again, it works well when a user is in the loop because the user never keeps application state, when you navigate away from the resource representation there is no &#8220;real&#8221; application state left on your browser. In information systems architecture this assumption simply does not hold. When a resource interacts with another resource they keep a knowledge of their respective states (could just be implicit) and this is necessary to understand what inter-action comes next. You can never push all the state of the inter-action to a common location. You can have a shared state, for sure, though it is not required, but you can never pushed the application state outside the resource itself, because resources have an intrinsic state machine on which the unit of work (the application) they are currently involved in relies upon. Most often (99% of the time) you never want to share all your state as part of the interactions.</p>
<p>What you are telling us is that a different URI will point to a different code base? how can you be sure you are talking about the same resource. Identity is now mixed with Version of the action interface to the resource (not the resource itself). That does not sound like a good design if you ask me.</p>
<p>At the end of the day, the RESTifarians come in as if Information Systems are a brand new thing and we are still discovering some of their core features. In case you have not noticed, information systems were invented 8000 years ago, yes, 8000 years ago, in the middle-east. They brought us civilization, writing, with writing, knowledge, education (word of mouth does not scale), science, philosophy&#8230; The characteristics of information systems are independent of &#8220;computing&#8221;. The killer app for computers in the 50s was &#8220;data processing&#8221;, it is only in the 70s with &#8220;permanent storage&#8221; and &#8220;online&#8221; access were invented that information systems started to be hosted entirely within a computer and computers did not just &#8220;compute&#8221; anymore.</p>
<p>Unfortunately, most people don&#8217;t realize that computing is different from managing information. They mix up pretty much everything: data, middleware, algorithms, programming languages, query languages&#8230; recently there was even a guy who commented on SimpleDB and started to argue that Data was not &#8220;relational&#8221;.  Guys, I have news for you. The principles of information systems have not changed for pretty much 8000 years: things like identity, content, states, representations, actions, inter-actions, trans-actions, privacy, signature, &#8220;relationality&#8221; of data, indexes&#8230; are still the same. The technology has changed but not the principles.</p>
<p>JJ-</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Subbu Allamaraju</title>
		<link>http://www.subbu.org/blog/2007/12/rest-and-loose-coupling/comment-page-1#comment-193</link>
		<dc:creator>Subbu Allamaraju</dc:creator>
		<pubDate>Fri, 21 Dec 2007 10:34:23 +0000</pubDate>
		<guid isPermaLink="false">http://wp.subbu.org/2007/12/rest-and-loose-coupling/#comment-193</guid>
		<description>&gt;&gt; An &quot;internal&quot; is the interface modeling the interaction with an other component from the component&#039;s
&gt;&gt; implementation point of view. When you are not sure to which consumer, a provider is going to be
&gt;&gt; connected, you have to create a model for it.

I now understand what you mean by &quot;internal&quot; interface. IMO, these internal interfaces on either end are due to version changes. At time t=0, let&#039;s say, both the producer and consumer speak v1.0 of the interface. Over time, some producers may be upgraded to v1.1, while the consumers may still be viewing the producers as conforming to v.1.0. This combination leads to some very interesting problems, as I blogged about in &lt;a href=&quot;http://www.subbu.org/weblogs/main/2005/08/web_services_ve_2.html&quot; rel=&quot;nofollow&quot;&gt;Web Services Versioning - Part 1&lt;/a&gt; and &lt;a href=&quot;http://www.subbu.org/weblogs/main/2004/12/web_services_ve_1.html&quot; rel=&quot;nofollow&quot;&gt;Web Services Versioning - Part 2&lt;/a&gt; a couple of years ago. In the case of Web Services, we ended up relying on XSD namespaces, which turned out be nice at the interface level, but hard at the code level. Hard because, XSD driven code generation is tied to namespaces, and one ends up duplicating code or building additional layers.

Coming back to the case of REST, there are two approaches that people tend to take for versioning interfaces:

a. Provide a different set of URIs for each version for major (I mean really MAJOR) changes that are incompatible with the current version
b. Change encoding formats (xml, json, query params etc.) such that they are forwards/backwards compatible.

These solutions do work in practice, and that is why I do not agree that REST does not address versioning. To me, versioning takes some skill and experience no matter what interface description technology one is using.

&gt;&gt; What verbs are you talking about? the one from the uniform interface or the actions?

I meant HTTP methods such as GET, PUT etc. Those are also the actions in &quot;action-oriented&quot; speak.

&gt;&gt; If yes, now, let&#039;s assume you have two components that each have been implemented based on
&gt;&gt; their internal interface Pi and Ci, how do you wire them together with REST (knowing that the
&gt;&gt; only plug you have is Ce=Pe=(GET, PUT, DELETE, POST)? I know that you marshal actions with
&gt;&gt; links, perfectly ok, but the question is how do these links get wired to Ci or to Pi? How&#039;s the code
&gt;&gt; look like? Could that code be the wild-wild-west you were talking about?

In the model I described, the internal interface is merely &quot;a&quot; version of the interface, and so, there is no internal vs external question. So, the wireup is more natural, since the consumer knows only one version of the interface. As long as the producer is maintaining compatibility, things work. No wild-west here.
</description>
		<content:encoded><![CDATA[<p>>> An &#8220;internal&#8221; is the interface modeling the interaction with an other component from the component&#8217;s<br />
>> implementation point of view. When you are not sure to which consumer, a provider is going to be<br />
>> connected, you have to create a model for it.</p>
<p>I now understand what you mean by &#8220;internal&#8221; interface. IMO, these internal interfaces on either end are due to version changes. At time t=0, let&#8217;s say, both the producer and consumer speak v1.0 of the interface. Over time, some producers may be upgraded to v1.1, while the consumers may still be viewing the producers as conforming to v.1.0. This combination leads to some very interesting problems, as I blogged about in <a href="http://www.subbu.org/weblogs/main/2005/08/web_services_ve_2.html" rel="nofollow">Web Services Versioning &#8211; Part 1</a> and <a href="http://www.subbu.org/weblogs/main/2004/12/web_services_ve_1.html" rel="nofollow">Web Services Versioning &#8211; Part 2</a> a couple of years ago. In the case of Web Services, we ended up relying on XSD namespaces, which turned out be nice at the interface level, but hard at the code level. Hard because, XSD driven code generation is tied to namespaces, and one ends up duplicating code or building additional layers.</p>
<p>Coming back to the case of REST, there are two approaches that people tend to take for versioning interfaces:</p>
<p>a. Provide a different set of URIs for each version for major (I mean really MAJOR) changes that are incompatible with the current version<br />
b. Change encoding formats (xml, json, query params etc.) such that they are forwards/backwards compatible.</p>
<p>These solutions do work in practice, and that is why I do not agree that REST does not address versioning. To me, versioning takes some skill and experience no matter what interface description technology one is using.</p>
<p>>> What verbs are you talking about? the one from the uniform interface or the actions?</p>
<p>I meant HTTP methods such as GET, PUT etc. Those are also the actions in &#8220;action-oriented&#8221; speak.</p>
<p>>> If yes, now, let&#8217;s assume you have two components that each have been implemented based on<br />
>> their internal interface Pi and Ci, how do you wire them together with REST (knowing that the<br />
>> only plug you have is Ce=Pe=(GET, PUT, DELETE, POST)? I know that you marshal actions with<br />
>> links, perfectly ok, but the question is how do these links get wired to Ci or to Pi? How&#8217;s the code<br />
>> look like? Could that code be the wild-wild-west you were talking about?</p>
<p>In the model I described, the internal interface is merely &#8220;a&#8221; version of the interface, and so, there is no internal vs external question. So, the wireup is more natural, since the consumer knows only one version of the interface. As long as the producer is maintaining compatibility, things work. No wild-west here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Jacques Dubray</title>
		<link>http://www.subbu.org/blog/2007/12/rest-and-loose-coupling/comment-page-1#comment-192</link>
		<dc:creator>Jean-Jacques Dubray</dc:creator>
		<pubDate>Thu, 20 Dec 2007 14:43:05 +0000</pubDate>
		<guid isPermaLink="false">http://wp.subbu.org/2007/12/rest-and-loose-coupling/#comment-192</guid>
		<description>Subbu:

you misread my post, I talked about Internal interfaces and external interfaces in the context of loose-coupling. I would encourage you to read it again.

An &quot;internal&quot; is the interface modeling the interaction with an other component from the component&#039;s implementation point of view. When you are not sure to which consumer, a provider is going to be connected, you have to create a model for it.

You keep playing with the fact that REST does not need actions and yes actions are everywhere. Could you please clarify what you mean by:

&gt;&gt; Set of URIs for the verbs that they can respond to  (I don&#039;t understand the use of &#039;for&#039;)

What verbs are you talking about? the one from the uniform interface or the actions?

Could you please clarify whether the internal interface must be described in terms of actions?

If yes, now, let&#039;s assume you have two components that each have been implemented based on their internal interface Pi and Ci, how do you wire them together with REST (knowing that the only plug you have is Ce=Pe=(GET, PUT, DELETE, POST)? I know that you marshal actions with links, perfectly ok, but the question is how do these links get wired to Ci or to Pi? How&#039;s the code look like? Could that code be the wild-wild-west you were talking about?

thanks,

JJ-
</description>
		<content:encoded><![CDATA[<p>Subbu:</p>
<p>you misread my post, I talked about Internal interfaces and external interfaces in the context of loose-coupling. I would encourage you to read it again.</p>
<p>An &#8220;internal&#8221; is the interface modeling the interaction with an other component from the component&#8217;s implementation point of view. When you are not sure to which consumer, a provider is going to be connected, you have to create a model for it.</p>
<p>You keep playing with the fact that REST does not need actions and yes actions are everywhere. Could you please clarify what you mean by:</p>
<p>>> Set of URIs for the verbs that they can respond to  (I don&#8217;t understand the use of &#8216;for&#8217;)</p>
<p>What verbs are you talking about? the one from the uniform interface or the actions?</p>
<p>Could you please clarify whether the internal interface must be described in terms of actions?</p>
<p>If yes, now, let&#8217;s assume you have two components that each have been implemented based on their internal interface Pi and Ci, how do you wire them together with REST (knowing that the only plug you have is Ce=Pe=(GET, PUT, DELETE, POST)? I know that you marshal actions with links, perfectly ok, but the question is how do these links get wired to Ci or to Pi? How&#8217;s the code look like? Could that code be the wild-wild-west you were talking about?</p>
<p>thanks,</p>
<p>JJ-</p>
]]></content:encoded>
	</item>
</channel>
</rss>
