Re: REST and DELETE?

Mark Baker <[email protected]>
Newsgroups gmane.comp.web.services.rest
Message-ID <CALcoZipP_twTeDaUf-fGAWi3BGrXkL1RVA059m6oOuby_8TxYg@mail.gmail.com>
Hi Darrel,

On Thu, Aug 23, 2012 at 10:19 PM, Darrel Miller <[email protected]> wrote:
> So what happens if the store decides in it's wisdom to use URIs to identify
> products, and so the message would be,
>
> POST /order
> Content-Type: application/vnd.aonlinestore.orderform
>
> <order>
>    <partno>http://aonlinestore.com/products/1234232323</partno>
>    <qty>1</qty>
>    <price>51.99</price>
> </order>
>
> Now the partno is a link to another resource that describes the product.
> Are we still self-descriptive?

Presumably. The two strings are identifiers for the same resource, so
the meaning of those messages appears to be the same.

>
> What if the store decided that using SKUs (stock keeping units) was a better
> option and so now a quantity isn't necessary.
>
> POST /order
> Content-Type: application/vnd.aonlinestore.orderform
>
> <order>
>    <sku>http://aonlinestore.com/sku/1234232323Q1</sku>
>    <price>51.99</price>
> </order>
>
> Now my order is even more dependent on an external resource to identify what
> I am buying.

That depends how the media type is defined. If it prescribes that the
use of a SKU fixes the quantity by the use of the URI, and that
quantity is invariant over time, then the message would have the same
meaning as the others ... at least at the point in time when you make
that determination. Self-description requires that be true for all
time though (so it always reflects the original intent of the user),
so you'd better have an ironclad guarantee that the vendor won't
change that out from under you. That's the value standardization
brings to self-description.

At least, that's how I see it. I'm hardly the authority on this stuff,
but I think I've given it a lot more thought than the average
developer.

Mark.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.