In
distributed computing
A distributed system is a system whose components are located on different networked computers, which communicate and coordinate their actions by passing messages to one another from any system. Distributed computing is a field of computer sci ...
, 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
Network, networking and networked may refer to:
Science and technology
* Network theory, the study of graphs as a representation of relations between discrete objects
* Network science, an academic field that studies complex networks
Mathematics ...
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 (for example
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 ...
,
VBScript
VBScript (''"Microsoft Visual Basic Scripting Edition"'') is an Active Scripting language developed by Microsoft that is modeled on Visual Basic. It allows Microsoft Windows system administrators to generate powerful tools for managing computers ...
),
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,
ActiveX control
ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide Web ...
s,
Flash animation
Adobe Flash animation or Adobe Flash cartoon (formerly Macromedia Flash animation, Macromedia Flash cartoon, FutureSplash animation, and FutureSplash cartoon) is an animation that is created with the Adobe Animate (formerly Flash Professional) ...
s, Shockwave movies (and Xtras), and
macros embedded within
Microsoft Office
Microsoft Office, or simply Office, is the former name of a family of client software, server software, and services developed by Microsoft. It was first announced by Bill Gates on August 1, 1988, at COMDEX in Las Vegas. Initially a ma ...
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
In computing, a system image is a serialized copy of the entire state of a computer system stored in some non-volatile form such as a file. A system is said to be capable of using system images if it can be shut down and later restored to exactly ...
(this is important in cases where the running application needs to maintain its state as it migrates from host to host), 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:
*
Remote evaluation — A client sends code to a remote machine for execution.
*
Code on demand
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 a ...
— A client downloads code from a remote machine to execute locally.
*
Mobile agent In computer science, a mobile agent is a composition of computer software and data that is able to migrate (move) from one computer to another autonomously and continue its execution on the destination computer. In reality, the mobile agent is the ...
s — Objects or code with the ability to migrate between machines autonomously.
Implementations
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
*
Aglets — Mobile agent framework, Java
*
Java Agent Development Framework — Mobile agent framework, Java
*
Mobile-C — Mobile agent platform, C/C++
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
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 ...
in a
PDF
Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. ...
.
[
]
Viruses
Mobile code can also download and execute in the client workstation via email. Mobile code may download via an email attachment (e.g., macro in a Word file) or via an HTML email body (e.g., JavaScript). For example, the
ILOVEYOU
ILOVEYOU, sometimes referred to as Love Bug or Love Letter for you, is a computer worm that infected over ten million Windows personal computers on and after 5 May 2000. It started spreading as an email message with the subject line "ILOVEYOU" ...
, TRUELOVE, and AnnaK emails viruses/worms all were implemented as mobile code (VBScript in a .vbs email attachment that executed in Windows Scripting Host). 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.{{fact, date=January 2019
See also
*
Code on demand
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 a ...
*
Mobile agent In computer science, a mobile agent is a composition of computer software and data that is able to migrate (move) from one computer to another autonomously and continue its execution on the destination computer. In reality, the mobile agent is the ...
*
Remote evaluation
References
Distributed computing architecture
Types of malware