Code on demand
   HOME

TheInfoList



OR:

In
distributed computing A distributed system is a system whose components are located on different computer network, networked computers, which communicate and coordinate their actions by message passing, passing messages to one another from any system. Distributed com ...
, code on demand is any technology that sends executable software code from a server computer to a client computer upon request from the client's software. Some well-known examples of the code on demand paradigm on the web are
Java applet Java applets were small applications written in the Java programming language, or another programming language that compiles to Java bytecode, and delivered to users in the form of Java bytecode. The user launched the Java applet from a ...
s, Adobe's
ActionScript ActionScript is an object-oriented programming language originally developed by Macromedia Inc. (later acquired by Adobe). It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript (meaning i ...
language for the
Flash Player Adobe Flash Player (known in Internet Explorer, Firefox, and Google Chrome as Shockwave Flash) is computer software for viewing multimedia contents, executing rich Internet applications, and streaming audio and video content created on the ...
, and
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
. The program code lies inactive on a
web server A web server is computer software and underlying hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initiate ...
until a user (client) requests a web page that contains a link to the code using the client's
web browser A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used on ...
. Upon this request, the web page and the program are transported to the user's machine using
HTTP The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, ...
. When the page is displayed, the code is started in the browser and executes locally, inside the user's computer until it is stopped (e.g., by the user leaving the web page). Code on demand is a specific use of
mobile code In distributed computing, code mobility is the ability for running programs, code or objects to be migrated (or moved) from one machine or application to another. This is the process of moving mobile code across the nodes of a network as opposed ...
, within the field of
code mobility In distributed computing, code mobility is the ability for running programs, code or objects to be migrated (or moved) from one machine or application to another. This is the process of moving mobile code across the nodes of a network as opposed ...
.


Constraints


Client-Server

The first constraint is that the system must be made up of clients and servers. Servers have resources that clients want to use. For example, a server has a list of stock prices (i.e. a resource) and the client would like to display these prices in some nice graphs. There is a clear separation of concerns between the two. The server takes care of the back-end stuff (data storage, business rules, etc.) and the client handles the front-end stuff (user interfaces).


Stateless

To further simplify interactions between clients and servers, the second constraint is that the communication between them must be stateless. This means that all information about the client’s session is kept on the client, and the server is completely unaware. The consequence is that each request must contain all information necessary to perform the request (i.e. it cannot rely on any context information).


Cache

The last constraint on the client-server communication is that responses from servers must be marked as cacheable or non-cacheable. An effective cache can reduce the number of client-server interactions, which contributes positively to the performance of the system. At least, from a user’s point of view.


Cod

Code-on-Demand (COD) is the only optional constraint in REST. It allows clients to improve its flexibility because, in fact, it is the server who decides how certain things will be done. For instance, with Code-On-Demand, a client can download a javascript, java applet or even a flash application in order to encrypt communication so servers are not aware of any encryption routines / keys used in this process. However, using COD reduces visibility, which is why this constraint is optional. Also, not every API needs this kind of flexibility.


See also

*
Remote evaluation In computer science, remote evaluation is a general term for any technology that involves the transmission of executable software code from a client computer to a server computer for subsequent execution at the server. After the code has finished ...
*
Code mobility In distributed computing, code mobility is the ability for running programs, code or objects to be migrated (or moved) from one machine or application to another. This is the process of moving mobile code across the nodes of a network as opposed ...


References

{{DEFAULTSORT:Code On Demand Internet Protocol based network software Software distribution