Monday, February 25, 2008

REST principle

I was introduced to the REST architecture in our class. REST is basically a software architecture that outlines how resources are defined and addressed. Some key-features of REST includes:
- All resources has a unique URI.
- Each request is an independent transaction, i.e. stateless communication
- Employs standard methods, namely GET, POST, PUT, DELETE

We are working on building a Hackystat sensor for Visual Studio. REST is a very reasonable architecture but I don't think we need to provide a RESTful interface for the sensor. Basically, the sensor is build as an Add-In to Visual Studio where it extracts user activities and sends the data to the Hackystat SensorBase via the SensorShell. Since data transfer is done by the SensorShell, the main job is the sensor is to communicate between the SensorShell and the Visual Studio and so it doesn't need to employ REST principles. For example, it does not have use standard GET and POST methods.

The Hackystat SensorBase follows the REST principle pretty well. Resources are given their unique URIs and they are employing the standard HTTP methods which are GET, PUT, DELETE, HEAD, and POST.

On the other hand, I don't think the Hackystat ProjectViewer follows the REST principle. Resources all share the same URI. Users are not able to retrieve a particular resources by typing in URI alone.

No comments: