Why I started studying REST
On November 9 2008 my son Michael tells me about his new work. He needs to develop a a Web service for the company.
Michael told me that the company considers several options for producing a service. The goal is to substitute the existent application that is based on the processing of MS Word document by VBA.
He also told me that the company considers using REST.
Why SOA (Service Oriented Architecture) looks great?
We are used to Internet. We create our own Web pages (blogs) and a page is available to everyone in the world. However, a response from Internet is limited to HTTP protocol. It is not a real-time computing when a client can invoke user functionalities in the interactive mode.
We need client-server computing coupled with the availability of Internet.
Why REST looks great?
I have been working with client-server architecture starting from 1997.
CORBA came first
Why we needed CORBA?
Basically, any client-sever interaction can be programmed using TCP. Both client and server send information to each other using streams. The problem is that both a client and server have to serialize and deserialize information. Practically, we need to create our own protocol every time we use TCP.
Also, we need to write our own server and deal with possible complexities ourselves.
As usual, on paper it looks great. Using IDL (Interface Definition Language) one can define interfaces between a client and a server. Then, using a software from a CORBA vendor one can create prototypes for client and server methods using a language of choise. I worked mostly with C++.
Once we created a client and a server, we need to establish connection between them. We need an Object Request Broker that comes from a CORBA vendor to provide this connection.
What is good in CORBA?
Using Interface Definition Language (IDL) one can define practically any functionality between a client and a server.
What is difficult in CORBA?
One needs to study IDL that is not a very common language
2.
We have a CORBA specific connection between a client and a server
3.
We depend on a software from a CORBA vendor. The problem in this software is not only the price. It is usually quite complicated, a manual consists of several books.
DCOM
DCOM is very similar to COBRA. Moreover, it is limited to Windows Operating systems.
SOAP/Web Service Definition Language (WSDL)
SOAP/WSDL is based on the Internet communications. It is similar to CORBA because the server methods are opened to a client.
There are 2 biggest advantages of Soap/WSDL.
1. The communications uses HTPP that is firewall friendly
. SrService definition is based on XML that is much easier to understand than DR and CDR (for CORBA and DCOM)
Disadvantage:
The communications requires interface specification using WSDL language. Can we avoid using a separate language for client server computing while computing through HTTP?
Why REST is sufficient?
In the WSDL architecture a user can generally call any procedure. A procedure corresponds to a verb in English. Also, practically any class can be described by WSDL.
However, practically any class can be described by XML also.
In the REST model the only verbs allowed are GET, POST, PUT and DELETE.
Get is usually used when no changes on a server occures.
A POST request usually serves for posting a message or providing a data for a database.
The Hypertext Transfer Protocol (HTTP) defines a PUT method as the mechanism allowing a WWW client to transfer a file to a WWW server (http://www.w3.org/Amaya/User/Put.html)
The DELETE method requests that the origin server delete the resource identified by the Request-URI (http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)
Do we need to do anything else? I do not see so.