Code on demand: Difference between revisions

Content deleted Content added
copyvio from: https://www.kennethlange.com/posts/What-are-RESTful-Web-Services.html
AnomieBOT (talk | contribs)
m Dating maintenance tags: {{Clarify}}
 
(13 intermediate revisions by 10 users not shown)
Line 1:
{{More citations needed|date=February 2022}}
In [[distributed computing]], '''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]]s, Adobe's [[ActionScript]] language for the [[FlashplayerAdobe Flash Player|Flash playerPlayer]], and [[JavaScript]].<ref name="Is Code Still Moving Around">{{cite book|last= Carzaniga|first=Antonio|author2=Gian Pietro Picco |author3=Giovanni Vigna |yeartitle=200729th International Conference on Software Engineering (ICSE'07 Companion) |titlechapter=Is Code Still Moving Around? Looking Back at a Decade of Code Mobility |journalyear=ICSE COMPANION '07 Companion to the Proceedings of the 29th International Conference on Software Engineering2007|publisher=IEEE Computer Society|___location=Washington, DC, USAUS|pages=9–20|url=http://dl.acm.org/citation.cfm?id=1248922|doi=10.1109/ICSECOMPANION.2007.44|isbn=978-0-7695-2892-2|citeseerx=10.1.1.119.5295|s2cid=8728428 }}</ref>
 
The program code lies inactive on a [[web server]] until a user (client) requests a web page that contains a link to the code using the client's [[web browser]]. Upon this request, the web page and the program are transported to the user's machine using [[HTTP]]. 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]], within the field of [[code mobility]].<ref name="Understanding Code Mobility">{{cite journal|last=Fuggetta|first=Alfonso|author2=Gian Pietro Picco|author3=Giovanni Vigna|year=1998|title=Understanding Code Mobility|url=http://www2.computer.org/portal/web/csdl/abs/trans/ts/1998/05/e0342abs.htm|journal=IEEE Transactions on Software Engineering|volume=24|issue=5|pages=342–361|doi=10.1109/32.685258|issn=0098-5589|accessdate=29 July 2009|citeseerx=10.1.1.20.3442}}</ref>
 
== Constraints ==
=== Client-Serverserver ===
The first constraint is that the system must be made up of clients and servers.
 
Line 15 ⟶ 17:
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 knowsis nothingcompletely of it (so no cookies, session variables, or other naughty stuff!)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 ===
Line 22 ⟶ 24:
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.
 
=== CodCode on demand ===
Code- on-Demand demand (COD) is the only optional constraint in REST. It allows clients to improve itstheir flexibility because in fact it is the server whowhich decides how certain things will be done. For instance, with Code-On-Demandcode on demand, a client can download a javascriptJavascript, javaJava applet or even a flashFlash application in order to encrypt communication so servers are not aware of any encryption routines / keys used in this process.{{Clarify|date=June 2024}}
 
However, using COD reduces visibility, whichhence isthe why this constraint is optionaloptionality. Also, not every API needs this kind of flexibility.
 
==See also==
Line 33 ⟶ 35:
== References ==
<references/>
 
{{Authority control}}
{{Use dmy dates|date=June 2024}}
 
{{DEFAULTSORT:Code On Demand}}
[[Category:Internet Protocol based network software]]
[[Category:Software distribution]]
 
<ref>{{Cite web|url=https://stackoverflow.com/questions/32094952/code-demand-constraint-for-restful-apis|title=Code_on_demand_stackoverflow|last=|first=|date=|website=|url-status=live|archive-url=|archive-date=|access-date=}}</ref> <ref>{{Cite web|url=http://restcookbook.com/Basics/codeondemand/|title=Constraint_optional|last=|first=|date=|website=|url-status=live|archive-url=|archive-date=|access-date=}}</ref>
 
<ref>{{Cite web|url=https://www.pjohnson.info/2015/03/31/code-on-demand-what-is-it/|title=Code on demand:what is it?|last=|first=|date=|website=|url-status=live|archive-url=|archive-date=|access-date=}}</ref>
 
<ref>{{Cite web|url=https://www.kennethlange.com/what-are-restful-web-services/|title=RESTful web services|last=|first=|date=|website=|url-status=live|archive-url=|archive-date=|access-date=}}</ref>
{{Comp-sci-stub}}