REST is crawling: early binding and the web without hypermedia
Posted on 07. Feb, 2010 by guilhermesilveira in restful, soa
The most frequently asked question about REST in any presentation: why hypermedia is so important to our machine to machine software?
Is not early binding through fixed URI’s and using http verbs, headers and response codes better than what we have been doing earlier?
An approach that makes real use of all http verbs, http headers and response codes already presents a set of benefits. But there is not only the Accept header, not only 404, 400, 200 and 201 response codes: real use means not forgetting important verbs as PATCH and OPTIONS and supporting conditional requests. Not implementing features as automatic 304 (as a conditional requests) parsing means not using http headers and response codes as they can be used, but just providing this information to your system.
But if such approach already provides so many benefits, why would someone require a machine-to-machine software to use hypermedia? Is not it good enough to write code without it?
The power of hypermedia is related to software evolution, and if you think about how your system works right now (its expected set of resources and allowed verbs), hypermedia content might not help. But as soon as it evolves and creates a new set of resources, building unforeseen relations between them and their states (thus allowed verbs), that early binding becomes a burden to be felt when requiring all your clients to update their code.
Google and web search engines are a powerful system that makes use of the web. They deal with URIs, http headers and result codes.
If google’s bot was a statically coded bot that was uncapable of handling hypermedia content, it would require a initial – coding time or hand-uploaded – set of URIs coded that tells where are the pages on the web so it retrieves and parses it. If any of those resources creates a new relationship to other ones (and so on), Google’s early binding, static URIs bot would never find out.
This bot that only works with one system, one specific domain application protocol, one static site. Google would
not be able to spider any other website but that original one, making it reasonably useless. Hypermedia is vital to any crawling or discovery related systems.
Creating consumer clients (such as google’s bot) with early binding to relations and transitions do not allow system evolution to occur in the same way that late binding does, and some of the most amazing machine-to-machine systems on the web up to date are based in its dynamic nature, parsing content through hyperlinks and its semantic meaning.
Although we have chosen to show Google and web search engines as examples, any other web systems that communicate with a set of unknown systems (“servers”) can benefit from hypermedia in the same way.
Your servers can only evolve their resources, relations and states without requiring client-rewrite if your code allows service-crawling.
REST systems are based in this premise, crawling your resources and being able to access its well understood transitions through links.
While important systems have noticed the semantic value and power of links to their businesses, most frameworks have not yet helped users accomplishing late binding following the above mentioned principles.
6 Responses to “REST is crawling: early binding and the web without hypermedia”
Trackbacks/Pingbacks
-
-
February 9, 2010
[...] This post was mentioned on Twitter by caueguerra, Tiago "Pacman&q, Anderson Leite, Guilherme Silveira, Alberto Luiz Souza and others. Alberto Luiz Souza said: RT: @sergioazevedo: rest, crawling and why hypermedia #caelum #rest http://bit.ly/9bsybm (via @guilhermecaelum) [...]
-
-
February 12, 2010
[...] REST is crawling: early binding and the web without hypermedia [...]
-
-
February 15, 2010
[...] Running – A look at the initial version of the REST procurement service. (By Jan Algermissen) REST is crawling: early binding and the web without hypermedia – A discussion on early vs. late binding in REST applications. (By Guilherme Silveira) Using [...]
-
-
May 6, 2010
[...] em clientes, temos um servidor com forte acoplamento a contratos (schemas e infinitos verbos) que inibem a evolucão de seu servidor independente de seu cliente, o que chamamos de [...]
SUBSCRIBE TO OUR RSS
Mike
09. Feb, 2010
I think this is the same concept inferred by existing writings about ‘discoverability’ and the hypertext constraint, and an objective of specific projects such as linked data and the semantic web.
guilhermesilveira
09. Feb, 2010
I agree with you, Mike. Seems like there is no way to disconnect REST evolutioned systems with linked data and the semantic web (thus its a pity that www2010 will hold similar workshops on the same day)