Code On Demand

How Interactive Websites Are Made

In this generation of the internet, web applications have become popular. These applications are created for a wide variety of purposes by individuals and organizations. Having said that, the concept of code on demand has also emerged. In this site, we will learn more about what is code on demand, what makes it a hot topic, a bit of its history, and it's benefits and fallbacks.

Get started

What is Code On Demand?

Today, the world wide web has been widely used by many people around the globe. Users pay their bills, shop online or book a service with the use of the internet with desktop and mobile phone applications at a faster rate of response time. If we look at it, the technology behind has improved rapidly to handle the process a single or multiple transactions as it is using a distributed system. This type of systems refer to a cluster of computers (and can be accessed online) that works altogether and produce an output or a series of outputs to the end user.

In the paradigm of distributed computing, the technology of code on demand is being utilized often. This is when a user from a client machine performs an action e.g. clicks a button, and creates a request to a server machine and then the server machine performs the request using an executable program and response back to the client.

A few of the widely-used instances of the code on demand models are web are Java Applets, ActionScript that is used in Flash Player, and JavaScript.

In the previous generations of how internet is being used, websites are just mostly rendering documents that are static in which the web client and server is the browser itself. However since then, it had evolved to consume REST (representational state transfer) application user interfaces technologies in which a browser grabs and displays the initial state of the HTML document amd provides support to "script" tags found within the document so that an executable software application can be loaded or rendered on-demand .


What Makes a COD System

Model

Client-Server

A COD system must be composed of two components: clients and servers.

Servers are the location where resources are saved that client machine may want to use. For example, a server has a list of sales data (.e.g. a resource) and a client device would like to view the list of sales per day and their totals in a graph.

The difference between the two are obviously seen. The server machine handles the storage of data, computations, business rules and rospnses to applications while the client takes care of the user interactions.

Model

Statelessness

When client and server communicates, the state of information between the two remains on themselves.

This simply refers that all data from the user machine's session is stored entirely on the client, and the server is totally not informed of. Whenever the client application generates an HTTP request, it put all data needed for the server side to satisfy the request

The server will removes all data that were requested previously ny the client. If in a case that an information is crucial, this means that the client have to send that as a part of the current request.

Model

Caching

The final composition of COD on the client-server interaction is that the information responses provided by the servers can be labeled as cacheable or non-cacheable. It usually involves temporarily keeping copies of files in a non-permanent location in the client or server machine that can be accessed rapidly.

These two variations of caching can effectively reduce the number of interactions between two systems, which helps the request and responses process perform better. At least from the end user's perspective


Examples of Code on Demand


Java applets

A java applet is a tiny program made from java that can execute in any java compiler-interprer enabled interfaces such as browers or an applet viewer program. It provides interactive functions to the applications on the web as browsers being executed. They are tiny yet portable programs inserted in HTML pages and automatically put into effect when the pages are loaded.

Applets can run on multi-platform operating systems independently. It is loaded rapidly on the browser and can fully run on the client computer without communicating to the server.

Java applets are secure as it is made from java program and only trusted and registered apps to APS (Applet Security Manager) can be used.

Example Uses
  • Utilitiy Programs: simple calculators, digital clock app, simple spreadsheets, online calendar
  • Text Moving Animations: color change, morphing text, text flash effects
  • Music Processing: online piano, digital radio buttons
  • Interactive Games: Crossword puzzles, Minesweeper, Solitaire Card Game
  • Etc: Graph and charts, digital simulators for flights
Limitations
  • A few mobile browsers from iOS and Android devices does not support applets
  • Not able to capture streaming data from a browser
  • Not flexible enought to capture events triggered that is not inside applet application
  • Cannot execute and modify internal softwares on a client computer

Actionscript

ActionScript is a scripting language that was created to offer interactivity on Adobe's Flash Player software. It originated from Macromedia Inc. then later the company was bought by Adobe Systems. It is developed fundamentally to generate most kinds of fully interactional applications including animated websites and mutimedia device games that are in the SWF file forms.

ActionScript enables the developers add complexity on the immersiveness of the audio and visual effects of an application. It makes it possible to generate user interface environments that can accept user's action and respond through a click or keyboard strokes. This language is based on the event action by the user. Actionscript uses Flash Integrated Development Environment (IDE) where a developer can generate or update FLA file types.

ActionScript works similarly to it's cousin, JavaScript, however it is created purely to run on applications with Flash player installed.

Advantages
  • Object Oriented Language: Has many libraries that supports a wide variety of applications and online games for animations, rendering features, etc.
  • High-quality of video and animation contents
  • Allows developers to process vector graphics or muti-dimension animations
  • Enables users to upload content texts and visuals to a site and also can be progressively download files
Limitations
  • Uses a lot of CPU power due to its lack of support to put it on a virtual machine
  • Flash-based applications are prone to crashing
  • To much dependency to flash-player enabled browsers which makes it less universal
  • Not indexable by search engines.
Sample Flash Player Game
Super Mario Flash Game
Flash Player
Adobe Flash Player.

Java Script

JavaScript is a programming language that mostly uses scripts that creates interactivity on web pages. It works together with HTML and CSS which are providing the site structure and the styling to the website pages. Javascript provides behaviour on elements of the pages in a way a user is able to take action. A few of the examples of Javascript applications include online forms, image modal effects, button click effects, interactive games and many more.

JavaScript was initially developed to primarily serve website applications and online browsers. However, it evolved to be used on back-end servers, and even to control hardware units. Here's a few of the list that Javascript can do:

Example Uses
  • Adding events to elements of web pages
  • Building website and responsive appllications
  • Setting up website servers and other server applications
  • Online interactive games development
Advantages
  • It is build as a native standard to browsers
  • Easy to learn for developers
  • Extended Functionality
  • Fast Response
node js
Node.js Framework
Super mario portal maker
Super mario portal maker, an example javascript game.

AJAX

Ajax refers to Asynchronous JavaScript and XML. This means that web applications can be developed and use this as a technique for better performance on loading elements such as HTML, XML, CSS, and Javascript altogether.

Ajax provides the ability to transfer data towards server and also get data from server in a form of sychronous distribution request. An example is filling up a form for information then click the submit button and then the user is able to see new output information on the screen. Information is coming from a server which is generated in real-time.

Simple Weather App


    History of COD

    Present

    Since 2019 to present day, JavaScript has remained on top of the most popular programming language around the globe.

    2020

    ActionScript's Flash player support was halted by Adobe Systems Inc.

    2017

    Java Applets was finally deprecated.

    2013

    Top website browsers have started to gradually eliminate Java Applets. Some reasons of applet's downfall are below:

    2007

    Apple Inc. announced to not support any Flash player-based animations which greatly affect ActionScript's popularity.

    2005

    ActionScript's owner Macromedia was fully obtained by Adobe Systems Inc., a US software firm.

    Ajax (Asynchronous JavaScript and XML), a web development paradignm, was introduced that boosted the popularity of Javascript.

    1998

    Actionscript was born.

    1996

    Netscape Communications announced Javascript as standard language for browsers through ECMA standardization.

    1995

    Java Applets was first introduced.

    JavaScript was also introduced.


    About the Author


    Reference Citations:
    Java Applets
    • https://www.trendmicro.com/vinfo/us/security/definition/java-applets
    • https://www.hubberspot.com/2012/04/applet-advantages-and-restrictions.html
    • https://quick-adviser.com/what-are-the-limitations-of-an-applet/
    • http://www.cs.toronto.edu/~nn/csc309/handouts/09-Sept30-Applets.pdf
    • https://www.infoq.com/news/2021/03/end-of-applets/
    • https://chemaxon.com/news/java-applet-technology-the-past-and-future-and-the-end
    ActionScript
    • https://www.academia.edu/28795966/OReilly_Essential_Action_Script_3_0_Jun
    • https://ukietech.com/blog/video-and-photo/pros-and-cons-of-macromedia-flash
    Javascript
    • https://www.hackreactor.com/blog/what-is-javascript-used-for
    • https://data-flair.training/blogs/advantages-disadvantages-javascript/
    • https://auth0.com/blog/a-brief-history-of-javascript/
    • https://immagic.com/eLibrary/ARCHIVES/GENERAL/ADTVPATH/A050218G.pdf
    • https://www.businessinsider.com/most-popular-programming-languages-github-2019-11#
    • https://www.tutorialspoint.com/ajax/what_is_ajax.htm