Can you help clarify some points regarding RESTful services and Code Generation?

I've been struggling with understanding a few points I keep reading regarding RESTful services. I'm hoping someone can help clarify.

1a) There seems to be a general aversion to generated code when talking about RESTful services.

1b) The argument that if you use a WADL to generate a client for a RESTful service, when the service changes - so does your client code.

Why I don't get it: Whether you are referencing a WADL and using generated code or you have manually extracted data from a RESTful response and mapped them to your UI (or whatever you're doing with them) if something changes in the underlying service it seems just as likely that the code will break in both cases. For instance, if the data returned changes from FirstName and LastName to FullName, in both instances you will have to update your code to grab the new field and perhaps handle it differently.

2) The argument that RESTful services don't need a WADL because the return types should be well-known MIME types and you should already know how to handle them.

Why I don't get it: Is the expectation that for every "type" of data a service returns there will be a unique MIME type in existence? If this is the case, does that mean the consumer of the RESTful services is expected to read the RFC to determine the structure of the returned data, how to use each field, etc.?

I've done a lot of reading to try to figure this out for myself so I hope someone can provide concrete examples and real-world scenarios.

5
задан John Saunders 10 March 2011 в 03:15
поделиться