I've also noticed that as I've been reading I keep finding myself wishing that some of the things in WS-* could be extracted and applied to a more RESTful environment. In particular, I keep wondering whether having something like WSDL would be useful.
Let's say that I have a real estate 'application' that deals with real estate listings. A listing resource has state that includes things like an address, a listing agent, a homeowner, a description, a listing status and a unique identifier. In order for client software to effectively use my 'application', I need to be able to define how the client can interact with resources of this type (e.g., listing resources). It seems to me that in order to construct a client that can interact with a particular type of resource, I need to know the following things:
- the resource's state or data model; i.e., what elements make up a listing resource's state (I guess this would essentially be a type definition)
- a list of valid transformations that can be applied to a listing resource; i.e., what parts of the resource's state can I change, and how do I go about effecting those changes
- a definition of valid values for the various parts of the resource's state (maybe this is really part of the data model)
I'm pretty sure that the first and last items are reasonable things to want. Its the middle one that I'm not so sure of. I can't help but think that I'm effectively trying to define new operations that can be performed on a resource, and that would seem to violate the constrained interface.
I did look at RDF Forms, but I'm not sure whether that's what I want or not. It seems like something is missing, but maybe I'm just making it more complicated than it needs to be
2 comments:
RDF Forms does a lot of this, but some of what you seem to need is implicit too. For example, you don't need any information other than a URI and a GET response to tell you that in order to change the state of the thing, you can PUT a modified version of that representation back. It may or may not have the desired effect (e.g. authorization may be required, or the resource isn't editable), but at least the meaning of both the request and response messages is unambiguous.
P.S. that's also why RDF Forms doesn't support PUT... though I suppose it could to cover the edge cases, for example where you have to PUT in a format that's different from what you GET.
Post a Comment