Thursday, September 20, 2007

Restful Web Services Review - Part 1

Restful Web Services book is the one to read these days. I enjoyed reading this book for a number of reasons. I've found this book challenging me and teaching me along the way.
I've decided to split a review into two parts. This blog entry is about what I liked about the book, what I found interesting. Next part will be about me trying to question some of the assumptions made in the book.

So here's what I liked about the book, in no particular order.

This book is written by people who believe in and more importantly, practise REST. This alone is a strong enough reason for anyone wishing to understand REST better to go and get the book.

I liked the style of the book, it is very moderate. Compared to some of the bloggers out there bashing WS-* to death, the authors showed how one needs to convince, not by using populist proclamations, but by rolling up the sleeves and teaching and showing how it all works. I found it encouraging me to think harder, trying to understand it better.

I thought I knew how POST was different from PUT. Oh, well :-) Now I do know ! Their description of why AmasonS3 service uses PUT to create new resources was both informative and practical.

The big plus of this book is that it presents a lot of the important information relevant to REST, HTTP, WEB which is spread across emailing archives, blogs and articles in a clear and concise way such that it's easy to understand and appreciate.

I liked a "My Web Service is my Web Site" idea. XHTML is given a lot of attention in this book and the effort to make XHTML a better language for the WEB deserves a lot of respect. Seeing how this format can be used such that the same response can be consumed by humans and machines was interesting. Microformats is a powerful idea all right.

I said it above but I found the coverage of big Web Services and contrasting them to RESTful services be moderate. Yes, authors believe REST does better overall but their conclusion didn't make me feel defensive. Obviously, the suggestion to try to refactor SOAP services such that they can respond to GETs is a good one which many people like.

Examples of how URIs should be formatted for different types of search requests were helpful. Things like when to use a comma, etc.

GET matters : one of the main messages I totally agree with. I personally believe GET matters most. I don't want to go into things like hypermedia of the application state (connectedness as authors describe it), late binding, etc. It's the ability to GET on the link is what really matters IMHO. GET and addressability.

Uniform interface : universal clients. Powerful. More comments though on it in the second part.

Great point about links, about how resources relate to each other, about driving the application from one state to the other one.

Suggestions to create separate resources to deal with asynchronous operations and to model the relationships are practical and useful.

Set of best practices on how to build RESTful web services is possibly the best one I've ever read.

There're other things which I may've missed.

Overall, I liked the book a lot. Useful, practical, insightful, and yes, challenging, if you're still, like myself, see some value in those embattled WS-* :-).
I have little doubt now one can rewrite pretty much every web service out there using a true 100% RESTful approach. I'm not convinced it is the right idea though in all cases where HTTP is involved. Or may be I just don't understand it and not seeing far enough. I'm open and I'm learning. I'll try to argue with a book :-) a bit in the second part.

Do I recommend the book ? Of course I do !!!

No comments: