Code on Demand, REST, and Cloud Computing

Joe Gregorio

Tim O'Reilly

A key test of whether an API is open is whether it is used to enable services that are not hosted by the API provider...

Kevin Marks points out that the definition is too weak, a point which Tim concedes.

Regardless, one aspect of REST that gets frequently overlooked is Code on Demand. From Roy's Thesis:

In the code-on-demand style, a client component has access to a set of resources, but not the know-how on how to process them. It sends a request to a remote server for the code representing that know-how, receives that code, and executes it locally.

The word 'code' here means JavaScript. Well, at the time it was written all the examples given were Java applets, but the idea is the same, that code is downloaded and executed. The takeaway here is that JavaScript is a fully fledged RESTful part of the web, and those JavaScript APIs, just like the hyptertext I pointed out yesterday, are RESTful points of integration of Cloud Computing.

It's almost as if the web were designed for this stuff.

Update: As Roy pointed out in the comments, his thesis contains a whole section describing why JavaScript is more RESTful than Java applets.

Did you mean all of the examples in that section were of Java? It should be noted that I devoted an entire section to describing why JavaScript is more RESTful than Java applets. I still think it is amusing that, six years later, people started referring to AJAX as a new thing.

Posted by Roy T. Fielding on 2008-08-06

Roy,

Yes, I meant that all of the examples in that section were of Java. I should have included a link to that latter section also. Thanks!

Posted by Joe Gregorio on 2008-08-06

comments powered by Disqus