Code On Demand
   HOME

TheInfoList



OR:

In
distributed computing Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different networked computers. The components of a distributed system commu ...
, 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 applet, small applications written in the Java (programming language), Java programming language, or another programming language that Compiled language, compiles to Java bytecode, and delivered to users in the form of Ja ...
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 (mean ...
language for the
Flash Player Adobe Flash Player (known in Internet Explorer, Firefox, and Google Chrome as Shockwave Flash) is a discontinuedExcept in China, where it continues to be used, as well as Harman for enterprise users. computer program for viewing multimedia c ...
, and
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
. The program code lies inactive on a
web server A web server is computer software and underlying Computer hardware, hardware that accepts requests via Hypertext Transfer Protocol, HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, co ...
until a user (client) requests a web page that contains a link to the code using the client's
web browser A web browser, often shortened to browser, is an application 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 scr ...
. Upon this request, the web page and the program are transported to the user's machine using
HTTP HTTP (Hypertext Transfer Protocol) 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, wher ...
. 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 Computer program, programs, code or objects to be data migration, migrated (or moved) from one machine or application to another. This is the process of moving mobile code across t ...
, 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 oppose ...
.


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.


Code on demand

Code on demand (COD) is the only optional constraint in REST. It allows clients to improve their flexibility because it is the server which 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, hence the optionality. Also, not every API needs this kind of flexibility.


See also

* Remote evaluation *
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 oppose ...


References

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