The REST - part1

Representational State Transfer is the basic architecture of Web.
"Representation State Transfer is intended to evoke an image of how a well-designed Web application behaves: a network of web pages (a virtual state-machine), where the user progresses through an application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use.",
as quoted by Roy Fielding who coined REST in his Ph.D dissertation to describe an architecture style of networked systems.
The resources scattered all around the web are identified by its URI.These URIs are the equivalent of a noun.Think how many nouns !! From "flick"ring pixels to "twitter"ing fingers.All the thoughts congregate to the web.Verbs describe the actions.We use verbs for funcion names in programming.GET is the action to fetch a web page , the representation of the resource identified by URI.It is the undamental action of a browser.Other verbs are : POST to add information, PUT to update information, DELETE removes information.They make the CRUD verbs for web as a database.REST is like modelling the web services as URI addressable resources. These REST type URIs are logical ones than physical.The URLs are parsed and the required data ie the represenatio is sent back to client. So the state of client changes as per the recievables.If we look in a hypertext document we see hyperlinks to other resources.
Each resource representation contains hyper-links. Following a hyper-link takes the client to the next state. Thus, within the resource representations themselves are pointers to the next states.
If we consider this concept in regard to OOP , it is like a "HTTP Object Model", as it was originally referred.
The REST-RPC style in flickr API looks like :-
GET services/rest?api_key=xx&method=flickr.photos.search&tags=sunflower
It gets the images with tag sunflower using the search method.
The Web uses embedded identifiers rather than link servers.So the authors need an identifier that closely matches the semantics they intend by a hypermedia reference, allowing the reference to remain static even though the result of accessing that reference may change over time. REST accomplishes this by defining a resource to be the semantics of what the author intends to identify, rather than the value correspondingto those semantics at the time the reference is created. It thus integrates with "tagging" on web .So the REST becomes the fundamental principle for a semantic web.

No comments:

Post a Comment