I've just been engaged in an interesting twitter chat about REST and basket checkout:
colin_jack @serialseb ...but as resources in their own right.
colin_jack @serialseb Yeah, thats an approach I like. I'd make it work as RESTful in my head by not seeing things linked to as part of session state...


serialseb @colin_jack Thats where I argue that passing URIs around is not necessarily unrestful, depending on what you do with such uri
colin_jack @serialseb I guess I just can't see client PUTting all the infromation in those cases, guess I need to read dissertation...
serialseb @mamund But thats the point. /cv is a generic resource that can have conneg. /cv.doc is a resource that has only one represetnation ever.


serialseb @colin_jack It delves from the argument that state exist within the representations. And that the server shouldnt rely on client behavior.
adean @serialseb Maybe you don't, but Roy doesn't say the representations are different to resources except where there is only one media-type
colin_jack @adean I guess I'm just not seeing how posting the whole basket for checkout works, are there any blog entries that specifically cover this.


serialseb @adean differenciating the representation from the resource doesn't always make sense.
serialseb @adean you're quire right. As for representations, we need to not downplay the existence of representation-specific resources, for which...



adean @colin_jack You can post to checkout if you want the server to choose the resource identifier: the actual name of checkout is opaque to REST
serialseb @adean if the server expects a shopping cart representation, it'd request whatever format it understands and become itself a UA.
adean @serialseb However ... what content-type should the server ask for?? And it certainly doesn't transfer a representations, so not RESTful
adean @serialseb Yes, you could post a link to the data (assuming that it could be anywhere on the web) if the server supports that ...
colin_jack @adean @serialseb How about if you have a ShoppingBasket and you POST a CheckoutRequest or something to it, or is that awful?
serialseb @adean ... on the server? What if the client simply does a PUT with Content-Type: text/uri-list and content being the uri to the basket?

colin_jack @adean Ahhh, yeah. Guess thats why Jim Webber/Ian Robinson and so on are calling their approach Web oriented.
adean @serialseb Because the 'personalised resource' is optional to clients: they can happily store the app state locally without failing checkout
adean @serialseb But if the client will PUT the whole basket to checkout (even if there is no 'personalised resource') then that's fine ...
adean @serialseb if the checkout requires the basket to be in session state (even if exposed as a resource), it's not RESTful ...

serialseb @colin_jack Well it's not about the tool, it's about the arch. The tool in question provides poor support for what is needed for the arch.

serialseb @adean Need to define what we cover by state. are you saying POST to /shoppingcart/2554 looses serendipity? Especially when the entire...

colin_jack @serialseb Yeah thats the solution I'd heard of, but if you do go for that then your still breaking the rules Neward talks about aren't you?

adean @colin_jack I agree with the statement. You can have a well-written Web application and use server session - you just can't call it RESTful
adean @CAMURPHY Heh, sorry, didn't know that! In that case, I'm definitely up to have it taped :-)

colin_jack @adean Already following your REST delicious "feed", he's definitely got a lot of good quotes. Here's a question, how far do you go with...




colin_jack @adean Would love to hear the talk, which bit is the fallacy (e.g. what he's saying or the other side).
colin_jack @serialseb Speaking of which I've got to buy Restful WCF when its out! :)
adean @colin_jack Already bookmarked :-) I subscribe to Ted's blog & this is one of the Fallacies I will be talking about at DDD


No comments:
Post a Comment