Monday, November 25, 2013

Missing something.h file while compling/installing a package in linux

This error can be remove just by installing development  package of that particular package.

Wednesday, November 20, 2013

What is REST

Dear All,

Here is a brief explanation about REST(REpresentational State Transfer) as per my understanding.

We have been using Web for years where we fetch/create/update some data using GET,POST or PUT methods. These methods are quite generals and can be applied on almost any resource available over Internet.The REST says that the same idea on which Web works cab be applied between machine to machine interaction. But REST is not limited to these operations only.

In other way, we can think of each Web applications as a state machine having some business logic to make state transitions of the resources. The idea of REST is to map each state transition onto some request to a resource and provide clients with links representing transitions available in the current state. Thus it models the state machine via representations and hyper links. In this way we can think of REST as replacement of RPC(remote procedure call). The advantage of REST over RPC is that REST provide loose coupling where as RPC is tightly coupled. In case of REST client just require a URL(i.e. location of resource) along with some arguments just to specify the next desired state  while in case of RPC, the client must have full domain knowledge of server side.

A good of example of REST is opening a bank account. For opening a bank account you usually go through following process,

1. Go to the bank fill a form and submit to clerk at counter no 1.
2. The clerk will check the form and give a slip back and instruct you to go counter no 2(may be the cashier)
3. Give money to the clerk and clerk will give a slip and instruct you to go the counter no 3
4. At counter 3 clerk sees your slip and give you a passbook.


Here if we replace bank clerk as servers,forms as request and slips as a states of a operations, we can think of a distributed application using REST principle.One more thing here which needs to be mentioned that servers may be in different management domain located far away from each other. In this way, we can have a distributed application involving computation among several heterogeneous machines.

A second example which is a hypothetical but more useful and practical.
Suppose you refrigerator is connected to Web and find that its Milk inventory is low. Now it can to a grocery server located somewhere end of the world. That grocery gives it the local grocery address in form a response containing local grocery store URL. The refrigerator now goes to local store and enquire about milk. The store gives it a number of options probably a list of different milk brands. Now refrigerator choose a milk brands and quantity, the store diverts refrigerator to go to a payment gateway and pay money. After paying money, the gateway may divert refrigerator to the store. Now store confirm order after which delivery may follow. Here a number of state of the same operation(ordering a milk) is involved. If you see closely no server has to remember the all the state. This in compliance with Web which is also stateless.


Here are quick summery of all the above discussion:

1. Web is already is using REST principle.
2. REST  eases communication among machines rather than between machine and human.
3. It is the success of Web that had led people think to extends Web principle and develop REST.
4. REST makes your client as well as server side development quick,easy,scalable,fast and reusable.
5. REST says nothing about technologies involved but since it is inspired by HTTP the obvious choice is HTTP.
6. REST models things as real worlds works in day to day life.


Ref:
1. http://www.looah.com/source/view/2284
2. http://www.quora.com/What-is-REST-in-laymans-terms
3. http://stackoverflow.com/questions/209905/representational-state-transfer-rest-and-simple-object-access-protocol-soap
4. http://www.sharedd.com/iamlayman/2012/10/29/when-should-i-rest/

Thanks and Regards
Lalit Patel