<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Modeling operations in REST</title>
	<atom:link href="http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/feed/" rel="self" type="application/rss+xml" />
	<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/</link>
	<description>Software plumbing using middleware wrenches</description>
	<lastBuildDate>Mon, 23 Jan 2012 15:53:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: billburke</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3452</link>
		<dc:creator><![CDATA[billburke]]></dc:creator>
		<pubDate>Thu, 01 Apr 2010 11:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3452</guid>
		<description><![CDATA[Well, you know that PUT or POST will work at least from the atom link.  If you&#039;re &quot;hacking&quot; the service, then do a post.  Server should respond with what methods it supports if the POST fails.  You could always look up the documentation of the service, or the link. :)  Usually the &quot;rel&quot; attribute of links are expressed as a URL that you can follow to find out more information about that link.

Also, there&#039;s a new method called PATCH for HTTP.  I still prefer links though.]]></description>
		<content:encoded><![CDATA[<p>Well, you know that PUT or POST will work at least from the atom link.  If you&#8217;re &#8220;hacking&#8221; the service, then do a post.  Server should respond with what methods it supports if the POST fails.  You could always look up the documentation of the service, or the link. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Usually the &#8220;rel&#8221; attribute of links are expressed as a URL that you can follow to find out more information about that link.</p>
<p>Also, there&#8217;s a new method called PATCH for HTTP.  I still prefer links though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Schroeder</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3451</link>
		<dc:creator><![CDATA[Frank Schroeder]]></dc:creator>
		<pubDate>Thu, 01 Apr 2010 09:22:57 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3451</guid>
		<description><![CDATA[I would go with approach 3 as IMO it is the cleanest way of changing this specific state as it explicitly describes the operation that the server is going to perform.

PUTting the entire entity representation as in approach 1 just to change a single attribute seems overkill to me for several reasons. 

1. Why should I send an entire object if I want to change only a single attribute?
2. Why should the server derive the callers intention by comparing two representations (one from the database and one that was sent)?
3. Why should the server read the object that is to be changed from the database before changing it?

What if the object was changed in the meantime in a way that makes it ambiguous for the server to determine the intent of the caller?

This all seems like a lot of code for a simple operation.

Bill, I like the atom links with rel=&#039;terminate&#039; and an opaque URI. How does the caller know which HTTP verb to use? Is it always POST for atom links?

Frank]]></description>
		<content:encoded><![CDATA[<p>I would go with approach 3 as IMO it is the cleanest way of changing this specific state as it explicitly describes the operation that the server is going to perform.</p>
<p>PUTting the entire entity representation as in approach 1 just to change a single attribute seems overkill to me for several reasons. </p>
<p>1. Why should I send an entire object if I want to change only a single attribute?<br />
2. Why should the server derive the callers intention by comparing two representations (one from the database and one that was sent)?<br />
3. Why should the server read the object that is to be changed from the database before changing it?</p>
<p>What if the object was changed in the meantime in a way that makes it ambiguous for the server to determine the intent of the caller?</p>
<p>This all seems like a lot of code for a simple operation.</p>
<p>Bill, I like the atom links with rel=&#8217;terminate&#8217; and an opaque URI. How does the caller know which HTTP verb to use? Is it always POST for atom links?</p>
<p>Frank</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billburke</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3448</link>
		<dc:creator><![CDATA[billburke]]></dc:creator>
		<pubDate>Wed, 31 Mar 2010 14:06:21 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3448</guid>
		<description><![CDATA[Where is the dependency on any previous interaction other than finding out where the termination resource is located?]]></description>
		<content:encoded><![CDATA[<p>Where is the dependency on any previous interaction other than finding out where the termination resource is located?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Algermissen</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3447</link>
		<dc:creator><![CDATA[Jan Algermissen]]></dc:creator>
		<pubDate>Wed, 31 Mar 2010 13:45:13 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3447</guid>
		<description><![CDATA[You seem to think that the semantics of POST [empty] /customers/22/terminate include the notion that /customers/22/terminate is the &#039;terminate&#039; resource of /customers/22 because the server told the client via hypertext before, yes?

This is not so because the message can only be considered in isolation - it does not depend on any previous interaction - or if it does it is not self descriptive.

Besides all this - why not use a RESTful solution in the first place? Or just use the straight-forward DELETE /customers/22 ?]]></description>
		<content:encoded><![CDATA[<p>You seem to think that the semantics of POST [empty] /customers/22/terminate include the notion that /customers/22/terminate is the &#8216;terminate&#8217; resource of /customers/22 because the server told the client via hypertext before, yes?</p>
<p>This is not so because the message can only be considered in isolation &#8211; it does not depend on any previous interaction &#8211; or if it does it is not self descriptive.</p>
<p>Besides all this &#8211; why not use a RESTful solution in the first place? Or just use the straight-forward DELETE /customers/22 ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billburke</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3446</link>
		<dc:creator><![CDATA[billburke]]></dc:creator>
		<pubDate>Wed, 31 Mar 2010 13:17:49 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3446</guid>
		<description><![CDATA[Jan, I want to understand your argument, sincerely.

(Is this your blog?  I&#039;ll reply there too.)

I would agree with the assessment that if the &quot;terminate&quot; link supported multiple actions then it would be an antipattern and not REST.  But in my example, the &quot;terminate&quot; link does not represent multiple actions.  It represents a state transition to terminated.  There&#039;s absolutely no rule against one state change of one resource affecting another.  Also, in my example, there is no unterminate on the &quot;terminate&quot; link.  The &quot;terminate&quot; resource only accepts empty representations which mean to terminate (a form param of doit=true is just pedantic).  Instead there would be a &quot;reinstate&quot; link published by the consumer resource.  What I like about this approach is that the consumer resource is guiding the client on what it can do next by publishing links within its representation.  This is the whole point of HATEOAS and alot more self descriptive, especially if there are more complex rules for when and if a the consumer can be terminated or reinstated that can&#039;t be described by the media type easily.

I also don&#039;t get your timing point.  Is your point that between T2 and T5 the state of the consumer may change and terminate becomes  illegal? The server is always allowed to return a failure if the POST cannot be processed (i.e. precondition failed) if the timing is off and the terminate transition becomes illegal.

Finally The blog states that &quot;There is nothing in the request that allows the server to understand the actual intention of the client at the time the server handles the POST request.&quot;  The server is receiving an empty representation.  The server published (through the link) that it expects &quot;empty&quot; representations to do the terminate transition.  Of course the server is going to understand the intent of the request, because that&#039;s all it accepts.  Again, if you&#039;re into pedantic exercises, define a null media type or doing a form param doit=true.  I&#039;m not.]]></description>
		<content:encoded><![CDATA[<p>Jan, I want to understand your argument, sincerely.</p>
<p>(Is this your blog?  I&#8217;ll reply there too.)</p>
<p>I would agree with the assessment that if the &#8220;terminate&#8221; link supported multiple actions then it would be an antipattern and not REST.  But in my example, the &#8220;terminate&#8221; link does not represent multiple actions.  It represents a state transition to terminated.  There&#8217;s absolutely no rule against one state change of one resource affecting another.  Also, in my example, there is no unterminate on the &#8220;terminate&#8221; link.  The &#8220;terminate&#8221; resource only accepts empty representations which mean to terminate (a form param of doit=true is just pedantic).  Instead there would be a &#8220;reinstate&#8221; link published by the consumer resource.  What I like about this approach is that the consumer resource is guiding the client on what it can do next by publishing links within its representation.  This is the whole point of HATEOAS and alot more self descriptive, especially if there are more complex rules for when and if a the consumer can be terminated or reinstated that can&#8217;t be described by the media type easily.</p>
<p>I also don&#8217;t get your timing point.  Is your point that between T2 and T5 the state of the consumer may change and terminate becomes  illegal? The server is always allowed to return a failure if the POST cannot be processed (i.e. precondition failed) if the timing is off and the terminate transition becomes illegal.</p>
<p>Finally The blog states that &#8220;There is nothing in the request that allows the server to understand the actual intention of the client at the time the server handles the POST request.&#8221;  The server is receiving an empty representation.  The server published (through the link) that it expects &#8220;empty&#8221; representations to do the terminate transition.  Of course the server is going to understand the intent of the request, because that&#8217;s all it accepts.  Again, if you&#8217;re into pedantic exercises, define a null media type or doing a form param doit=true.  I&#8217;m not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Algermissen</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3445</link>
		<dc:creator><![CDATA[Jan Algermissen]]></dc:creator>
		<pubDate>Wed, 31 Mar 2010 10:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3445</guid>
		<description><![CDATA[Bill,

ask yourself: when the server receives POST [empty] /customers/22/terminate, how does it verify that the client&#039;s intention matches the current intended processing done by /customers/22/terminate?

See http://www.nordsc.com/blog/?p=414]]></description>
		<content:encoded><![CDATA[<p>Bill,</p>
<p>ask yourself: when the server receives POST [empty] /customers/22/terminate, how does it verify that the client&#8217;s intention matches the current intended processing done by /customers/22/terminate?</p>
<p>See <a href="http://www.nordsc.com/blog/?p=414" rel="nofollow">http://www.nordsc.com/blog/?p=414</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billburke</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3442</link>
		<dc:creator><![CDATA[billburke]]></dc:creator>
		<pubDate>Mon, 29 Mar 2010 13:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3442</guid>
		<description><![CDATA[Comparing a posted representation to the current representation to determine which complex logic to execute is NOT how the web works in practice.  In practice it is modeled more closely to the example I have given.  For good reason.

You&#039;ll have to explain your self-description argument here.  The meaning of a POST in my terminate resource example is the same no matter when the request is executed.  The meaning is to change the state to terminated.  So, I don&#039;t understand what you mean when you say that &quot;the meaning of the request depends on server side state&quot;.  Also, considering Roy in his thesis says &quot;REST constrains messages between components to be self-descriptive in order to support intermediate processing of interactions&quot; I don&#039;t see your point at all (he goes on to describe various *request* metadata). POST responses are not cached anyways.]]></description>
		<content:encoded><![CDATA[<p>Comparing a posted representation to the current representation to determine which complex logic to execute is NOT how the web works in practice.  In practice it is modeled more closely to the example I have given.  For good reason.</p>
<p>You&#8217;ll have to explain your self-description argument here.  The meaning of a POST in my terminate resource example is the same no matter when the request is executed.  The meaning is to change the state to terminated.  So, I don&#8217;t understand what you mean when you say that &#8220;the meaning of the request depends on server side state&#8221;.  Also, considering Roy in his thesis says &#8220;REST constrains messages between components to be self-descriptive in order to support intermediate processing of interactions&#8221; I don&#8217;t see your point at all (he goes on to describe various *request* metadata). POST responses are not cached anyways.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billburke</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3441</link>
		<dc:creator><![CDATA[billburke]]></dc:creator>
		<pubDate>Mon, 29 Mar 2010 12:43:30 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3441</guid>
		<description><![CDATA[There are multiple ways of handling versioning in REST+HTTP applications.  Conneg, well-designed media types, or just simply new URL schemes.  Much better and simpler options than anything else in the industry (if they even exist).  In SOAP land you have a hard enough time getting the stacks themselves to operate between versions let alone your applications.  But...I&#039;m sure you have some snotty, condescending response to whatever I write...Cheers.]]></description>
		<content:encoded><![CDATA[<p>There are multiple ways of handling versioning in REST+HTTP applications.  Conneg, well-designed media types, or just simply new URL schemes.  Much better and simpler options than anything else in the industry (if they even exist).  In SOAP land you have a hard enough time getting the stacks themselves to operate between versions let alone your applications.  But&#8230;I&#8217;m sure you have some snotty, condescending response to whatever I write&#8230;Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daily Digest for March 29th</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3440</link>
		<dc:creator><![CDATA[Daily Digest for March 29th]]></dc:creator>
		<pubDate>Mon, 29 Mar 2010 06:09:05 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3440</guid>
		<description><![CDATA[[...] http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/ interesting. [genexp]      Share and Enjoy: [...]]]></description>
		<content:encoded><![CDATA[<p>[...] <a href="http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/" rel="nofollow">http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/</a> interesting. [genexp]      Share and Enjoy: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Siarhei</title>
		<link>http://bill.burkecentral.com/2010/03/25/modeling-operations-in-rest/#comment-3439</link>
		<dc:creator><![CDATA[Siarhei]]></dc:creator>
		<pubDate>Sun, 28 Mar 2010 16:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/?p=359#comment-3439</guid>
		<description><![CDATA[Bill, I am not saying that your example is much different than &quot;edit&quot; link relation. In fact, that is the exact analogy, as I understood, you&#039;re trying to use.

What I am trying to say is that you don&#039;t need a &#039;edit&#039; link when PUT does just the same. Why would you want the &quot;edit&quot; link to point at the same resource, when PUT is much simpler, cleaner and (especially if the customer+xml is properly designed) even self-describing?

I can imagine that idea like rel=&quot;edit&quot; comes from Atom, but I am afraid is often taken out of context and &quot;re-used&quot; blindly. Where links like rel=&quot;edit&quot; come useful is if the content type is xhtml and you require a web form to be able to (eventually) perform a PUT. This is due to the fact that you can&#039;t just let a user to submit a PUT out of thin air and need a client to do so anyway. That&#039;s why &quot;edit&quot; links often point  at a form that simply allow in a user-friendly way to fill a form and eventually perform the very same PUT.

Now, coming back to your example... The link rel=&quot;terminate&quot; would certainly work. But that&#039;s not the point that I am trying to make.

The first point that I am trying to make out of it is that if terminate property is all (or almost all) there is to it then you don&#039;t need a link with a special meaning. Just change the property(ies) value and do a PUT. The url and standard HTTP methods for that are known! The terminate property is already in the customer resource and is properly modeled in the meda type. Having a link for that is not necessarily wrong but can be superfluous.

Another point that I am trying to make, is that *if* termination is not just a single property and actually needs to be a *separate* resource then having a link pointing at the termination resource might make sense (although I still wouldn&#039;t like it and use as a last resort when no better option/redesign is possible). 

I guess there may be different reasons many sites don&#039;t use Approach #1:
* They just use Atom and don&#039;t care about being RESTful which may happen alot in publishing/blogs. This is not to say Atom is not RESTful! You can be as RESTful or unRESTful with Atom as you wish.
* Their RESTful interface is built mainly for humans and not robots (hence the usefulness of &quot;edit&quot; links that would point at the edit form which in turn will facilitate the PUT&#039;ting).
* Overly complexity of resource model (see reasons I described above).
* Lack of understanding of REST principles. I also see many sites doing all kinds of unnecessary &#039;creativity&#039; such as putting action in a URL (e.g. action=delete) or other RPC-ish stuff.
* Whatever other, not mentioned here, reason (which I might have easily missed).]]></description>
		<content:encoded><![CDATA[<p>Bill, I am not saying that your example is much different than &#8220;edit&#8221; link relation. In fact, that is the exact analogy, as I understood, you&#8217;re trying to use.</p>
<p>What I am trying to say is that you don&#8217;t need a &#8216;edit&#8217; link when PUT does just the same. Why would you want the &#8220;edit&#8221; link to point at the same resource, when PUT is much simpler, cleaner and (especially if the customer+xml is properly designed) even self-describing?</p>
<p>I can imagine that idea like rel=&#8221;edit&#8221; comes from Atom, but I am afraid is often taken out of context and &#8220;re-used&#8221; blindly. Where links like rel=&#8221;edit&#8221; come useful is if the content type is xhtml and you require a web form to be able to (eventually) perform a PUT. This is due to the fact that you can&#8217;t just let a user to submit a PUT out of thin air and need a client to do so anyway. That&#8217;s why &#8220;edit&#8221; links often point  at a form that simply allow in a user-friendly way to fill a form and eventually perform the very same PUT.</p>
<p>Now, coming back to your example&#8230; The link rel=&#8221;terminate&#8221; would certainly work. But that&#8217;s not the point that I am trying to make.</p>
<p>The first point that I am trying to make out of it is that if terminate property is all (or almost all) there is to it then you don&#8217;t need a link with a special meaning. Just change the property(ies) value and do a PUT. The url and standard HTTP methods for that are known! The terminate property is already in the customer resource and is properly modeled in the meda type. Having a link for that is not necessarily wrong but can be superfluous.</p>
<p>Another point that I am trying to make, is that *if* termination is not just a single property and actually needs to be a *separate* resource then having a link pointing at the termination resource might make sense (although I still wouldn&#8217;t like it and use as a last resort when no better option/redesign is possible). </p>
<p>I guess there may be different reasons many sites don&#8217;t use Approach #1:<br />
* They just use Atom and don&#8217;t care about being RESTful which may happen alot in publishing/blogs. This is not to say Atom is not RESTful! You can be as RESTful or unRESTful with Atom as you wish.<br />
* Their RESTful interface is built mainly for humans and not robots (hence the usefulness of &#8220;edit&#8221; links that would point at the edit form which in turn will facilitate the PUT&#8217;ting).<br />
* Overly complexity of resource model (see reasons I described above).<br />
* Lack of understanding of REST principles. I also see many sites doing all kinds of unnecessary &#8216;creativity&#8217; such as putting action in a URL (e.g. action=delete) or other RPC-ish stuff.<br />
* Whatever other, not mentioned here, reason (which I might have easily missed).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

