19246Re: [rest-discuss] API versioning
- Jan 8, 2013Jørn Wildt wrote:
>From hypertext. NOT from knowledge of resource type coupled via custom
> My question is though - from where does the client get the
> information it needs to extract, say, the order sum, delivery
> address, order lines quantity and so on from the generic payload?
media type (vnd.order*). It seems like you're asking how to inform the
client that this resource type is "order" -- which is simply not
relevant to REST, where the only client knowledge required is of the
*interface* to the resource, not the *meaning* of the resource.
If my order-form <table> has a <th>quantity</th> column, then the
quantity of any item ID is the corresponding <td>, i.e. you code the
client with the XPATH expression which yields the answer you're looking
for, assuming XHTML. If Xforms is used, this XPATH expression is right
there in the form control binding, i.e. a self-documenting API.
>I might agree with that, if generic media types didn't have
> Actually, I would argue that a generic media type is more "typed"
> than a domain specific media type. Okay, that sounds like rubbish, I
> know - but let me explain:
> - as I stated above, a domain specific media type lets you derived
> useful information from a resource without making any assumptions
> about its underlying type.
extensibility mechanisms like, oh I dunno, link relations... AFAIC,
domain-specific media types _are_ assumptions about the underlying
type, i.e. an "order" is too unique a snowflake to express generically;
what other conclusion *can* be drawn about how vnd.order* types are
used in practice?
>OK, this is where these discussions always lose me. A browser needs to
> - whereas a generic media type forces the client to magically assume
> the resource has a specific type with specific properties you can
> extract from the generic payload.
know *nothing* about resource type, to allow a user to place an order
from, like, a bazillion different websites. In REST, the client just
needs to know how to manipulate generic hypertext controls. What is it
about order processing that makes folks think the client needs to know
that it's processing an order?
Now playing, ***** stars for sure:
- << Previous post in topic Next post in topic >>