Code mobility


In distributed computing, code mobility is the ability for running programs, code or objects to be migrated from one machine or application to another. This is the process of moving mobile code across the nodes of a network as opposed to distributed computation where the data is moved.
It is common practice in distributed systems to require the movement of code or processes between parts of the system, instead of data.
Examples of code mobility include scripts downloaded over a network, Java applets, ActiveX controls, Flash animations, Shockwave movies, and macros embedded within Microsoft Office documents.

Overview

The purpose of code mobility is to support sophisticated operations. For example, an application can send an object to another machine, and the object can resume executing inside the application on the remote machine with the same state as it had in the originating application.
According to a classification proposed by Fuggetta, Picco and Vigna, code mobility can be either strong or weak:
strong code mobility involves moving both the code, data and the execution state from one host to another, notably via a process image, while weak code mobility involves moving the code and the data only. Therefore, it may be necessary to restart the execution of the program at the destination host.
Several paradigms, or architectural styles, exist within code mobility:
Within code mobility, the Mobile Agent paradigm has conventionally attracted the most interest and research, however some recent work has produced general purpose implementations.
;Mobile agent frameworks
Mobile code can also be encapsulated or embedded in other file formats not traditionally associated with executable code. An example of this form of encapsulation is the presence of JavaScript in a PDF.

Viruses

Mobile code can also download and execute in the client workstation via email. Mobile code may download via an email attachment or via an HTML email body. For example, the ILOVEYOU, TRUELOVE, and AnnaK email viruses/worms all were implemented as mobile code. In almost all situations, the user is not aware that mobile code is downloading and executing in their workstation.

Renting code

Mobile code also refers to code "used for rent", a way of making software packages more affordable. i.e. to use on demand. This is specially relevant to the mobile devices being developed which are cellular phones, PDAs, etc. all in one. Instead of installing software packages, they can be "leased" and paid for on a per-usage basis.