Home > REST Constraints > Code-On-Demand


This optional constraint is primarily intended to allow logic within clients (such as Web browsers) to be updated independently from server-side logic. Code-On-Demand typically relies on the use of Web-based technologies, such as Web browser plug-ins, applets, or client-side scripting languages (i.e. JavaScript).

Code-On-Demand can further be applied to services and service consumers. For example, a service can be designed to dynamically defer portions of logic to service consumer programs. For example, this type of functionality can be used in support of Stateless, which dictates whether a session state should be deferred back to the service consumer. Code-On-Demand can also build upon this by further deferring the processing effort. This approach may be justifiable when service logic can be executed by the consumer more efficiently or effectively.


Because Code-On-Demand is classified as optional, architectures that do not use this feature can still be considered RESTful.