Re: Re: the meaning of stateless
"Eric J. Bowman" <[email protected]> Fri, 10 May 2013 21:49:15 -0600
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Organization | Bison Systems Corporation |
| Message-ID | <[email protected]> |
Bob Haugen wrote: > > Eric Bowman wrote: > > My nutshell explanation of REST from 50,000ft is that a system > > designed to manipulate shopping carts MUST be based on > > transferring actual representations of shopping-cart contents. > > I hesitated to get back into this issue after having lost an argument > with Mark Baker about it a couple of years ago, but: the typical > behavior of a system that saves shopping cart contents on servers > (e.g. Amazon) is to send a representation of the shopping cart > contents back to the client to confirm the order, in which case, a > representation of the shopping cart contents then gets sent back to > the server from the client. > > Would e.g. Mark and Eric agree that this is RESTful? > I'd say that how RESTful it is, depends entirely on the ubiquity of the media type used (text/html good, application/vnd.order+xml bad), and depends on at least item#, quantity, and price being present in the data. IOW, the hypertext of the order confirmation shouldn't amount to an agreement to buy x number of item y "at the agreed price" but should contain either the price agreed to before the transaction, or an updated price needing confirmation from the user before proceeding. Which means the hypertext MUST NOT contain only a link to the current price, or a link to the item# for a description -- such representation- by-reference is a bad thing. Sometimes, item #'s are re-used. I don't get this concept of substituting a link to shave bytes, because I use compression and it doesn't amount to much even on Amazon's scale, especially when considering those lost properties Roy mentions -- the cost of doing business in the modern world is bandwidth, cutting corners to shave bytes is sloppy business practice. -Eric