In the last few months I’ve been exposed to REST as an “architectural style”. I won’t get in to whether it’s good or bad, mostly because I just don’t care. What I do want to point out is that there are a lot of nutcases out there when it comes to technology. Last night I came across this:
-
HowSoapComparesToRest – RESTwiki
I think you’re missing the point. You are assuming that HTTP is a transport protocol, and that it therefore exists to carry bits, of which a SOAP-RPC message, which includes a method, is a valid payload. HTTP is not a transport protocol, it is an application protocol. It doesn’t send bits, it transfers representational state. If the body of a POST or PUT is not a piece of representational state, you’re not doing REST. HTTP already defines the methods, it doesn’t need new ones inside the POST body –MarkBaker
Now, correct me if I’m wrong, but isn’t HTTP the hypertext transfer protocol? I hate wackjobs that insist on fuddling over whether it’s an “object or a resource”, or claiming “it’s not a method call, it’s a POST“. Honestly, what does that mean? Have you nuts ever heard yourself talk? So what if I call it a method. In fact, if your REST architecture is any good I’d hope it has method facads to help your mere-mortal developers inch along.
Some people agree that REST could actually be applied to non-HTTP technologies; because, to be quite honest, those verbs (GET, POST, PUT, DELETE) can easily be reproduced as method calls:
public Widget getWidget(int id);
public void postWidget(Widget w);
public void putWidget(Widget w);
public void deleteWidget(Widget w);
Now some might freak out and say my getWidget() call shouldn’t take an id but rather a URI. So what, that can happen under the covers. People seem to forget that when building software there is only 1 thing that matters: getting the project done on time and within budget. So what if it’s written in PHP if the job gets done — I know the business people sure don’t.
However, let me qualify what “getting the job done” means. It means completing whatever task you were given. Now, if the task were “create a REST architecture” then I guess you don’t have much of a choice do you? But if the task is “create project X based upon specs Y and make it extensible for Z” then I can’t believe that REST is the only way to do this. Or C++, ruby, PHP, Java, JSP, EJB, SOAP, etc. You get the point.
But let me point out why I would claim that REST is probably the worst technology of choice: tools. SOAP, Java, EJB – they all have tools, good tools, to help developers utilize the technology. Tools are often overlooked by the supergeeks because they are too caught up in the religion of it all that they can’t see people struggling to work with their fancy new technology. If you’re working on Java and SOAP, you use Glue — it’s a great tool. For EJB, you use an application server + maybe XDoclet. If you’re writing Java, you have this wonderful tool called an I-D-E. It helps you compile and write code and see errors before they happen. Fancy that!
But what tools are there for REST? … Exactly. So I don’t stand here claiming it’s bad. I stand here claiming that it’s bad right now. Sure, you might be able to create some tools specifically for your project, but then you’re probably going to miss the requirement that all project boil down to: “in time and under budget”. If you can pull it off, more power to you (maybe you can donate your tools to the community too?)
In the meantime, I’ll stick with simple tools, like a compiler, to get the job done. The fanatics can keep taking about resources and URIs, but they often forget that underneath it all, a method is getting called somewhere and an object is being passed around.
on Nov 10th, 2005 at 4:53 am
Is there any REST? Or is it just MEST