REST touts that a "progresses through an application by selecting links (state transitions) resulting in the next page....
To borrow from a commonly used example, if I have a web service that "gets a list of parts", the URI to get the parts would look like this: http://www.parts-depot.com/parts and the "response" contains a list of links to the individual parts like this: <Part id="00345" xlink:href="http://www.parts-depot.com/parts/00345"/>
For additional information, I would have to "select" the link to "GET" information on the part.
What consumer application really wants to iterate through a list of links to get part detail information (other than a user interface)?
The Astoria samples are more liberal and actually return detail information for each product that exists (a URI is included also):
<DataService xml:base="http://host/vdir/northwind.svc">
<Products>
<Product uri="Products[1]">
<ProductName>Chai</ProductName>
<QuantityPerUnit>10 boxes x 20 bags</QuantityPerUnit>
<UnitPrice>18.0000</UnitPrice>
<UnitsInStock />
<UnitsOnOrder>0</UnitsOnOrder>
<ReorderLevel>10</ReorderLevel>
<Discontinued>False</Discontinued>
<ProductCategory href="Products[1]/ProductCategory" />
<Supplier href="Products[1]/Supplier" />
</Product>
<Product uri="Products[2]">
<ProductName>Chang</ProductName>
<QuantityPerUnit>24 - 12 oz bottles</QuantityPerUnit>
<UnitPrice>19.0000</UnitPrice>
<UnitsInStock>17</UnitsInStock>
<UnitsOnOrder>40</UnitsOnOrder>
<ReorderLevel>25</ReorderLevel>
<Discontinued>False</Discontinued>
<ProductCategory href="Products[2]/ProductCategory" />
<Supplier href="Products[2]/Supplier" />
</Product>
<!-- more products ... -->
</Products>
</DataService>
This just seems wrong to me and state transitioning seems to be shot. In other words, I think it becomes less about REST and more about HTTP and data formats. Maybe it's hi-REST versus low-REST?
Print | posted on Tuesday, May 01, 2007 10:07 AM