Re: Self-descriptive messages
Tim Williams <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <CAG_bHoxiNAULYDc-zVMUjy8CCbFhM2+tJvd1Ladpc2XCekcacQ@mail.gmail.com> |
On Fri, Aug 24, 2012 at 10:14 PM, Darrel Miller <[email protected]> wrote: > Mark, > > The interesting thing about the SKU scenario is that the URI may > actually capture the users intent more accurately than explicitly > stating the quantity. If the request body contains a URI that points > to http://aonlinestore.com/sku/jumbopackofshrimp then that maybe is > the exactly what that the user is requesting. The fact that this week > a jumbo pack of shrimp contains 10 shrimp and last week it contained 8 > shrimp is irrelevant to the user because the identifier is specifying > what the user wants. > > I believe that to discount the my weathersnapshot scenario based on > the fact that I used a text/uri-list is addressing a different point. > I admit that I tend to be somewhat more cavalier about allowing the > server to pile on semantics to a message than I would ever allow a > client to do and I realize that't not a good idea. However, I believe > the point I was trying to make is just as valid if I were to use > application/vnd.acme.list-of-uris-to-weather-images. > > What are negative effects of allowing a server to dereference a link > contained in the request to acquire all the information necessary to > process the request? It's been a while, I'll take a stab... assuming it's truly a URL and not a URI... Performance - the server now has to do the de-referencing of a one or more URLs. Complexity - the order example requires a transaction and de-referencing adds to the list of things that can go wrong. Understandability - from a client perspective, it's less understandable - guarantees that key attributes (e.g. price) of the target resource hasn't changed and the like. maybe that could be covered by some 'purchasing protocol' or somesuch? Reliability - if the URL needs to be de-referenced and that server is unresponsive, your whole system is down. Visibility - moot, because of POST. Some are admittedly a stretch:) What are the advantages? Thanks, --tim