Code Demand Constraint for RESTful APIs

As a newbie i am trying to understand REST and its principles. I have read some articles about it but struggling to undestand Code Demand Constraint which is the only optional constraint. What is it ? How and when to implement it? Any help would be appreciated.

Answers


Roy Fielding's thesis, effectively the original source on REST, defines the Code-On-Demand constraint as follows:

REST allows client functionality to be extended by downloading and executing code in the form of applets or scripts. This simplifies clients by reducing the number of features required to be pre-implemented. Allowing features to be downloaded after deployment improves system extensibility. However, it also reduces visibility, and thus is only an optional constraint within REST.

At the time this was written, the web was mostly just static documents and the only "web client" was the browser itself. Now it's commonplace for JavaScript-powered web apps to be consuming REST APIs. This is an example of code on demand - the browser grabs an initial HTML document and supports <script> tags inside that document so that an application can be loaded on-demand.


Need Your Help

Why do I get WCF Exception “HTTP could not register URL http://+:80/MyService/”

c# wcf

I create my host with the endpointaddress it needs to use, like this:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.