Abstract
Logical mobility ranges from simple data mobility, where information is transferred, through code mobility that allows the migration of executable code, to mobile agents, in which code and data move together. Several application domains need a more flexible approach to code mobility than the one that can be achieved with Java and with mobile agents in general. This flexibility can either be required as a result of low network bandwidth, scarce resources, and slow or expensive connectivity, like in mobile computing settings, or scalability requirements like in applications on several thousand clients that have to be kept in sync and be updated with new code fragments. We show how to achieve more fine-grained mobility than in the approaches using mobile agents and Java class loading. We demonstrate that the unit of mobility can be decomposed from an agent or class level, if necessary, down to the level of individual statements. We can then support incremental insertion or substitution of, possibly small, code fragments and open new application areas for code mobility such as management of applications on mobile thin clients, for example wireless connected PDAs or mobile phones, or more in general distributed code update and management. This work builds on the formal foundation for fine-grained code mobility that was established in [3].
Introduction
In the late 1990s and early 2000s, "code mobility"—the ability to move executable code across a network—was dominated by Java applets and mobile agents. However, these technologies were "coarse-grained": if you wanted to change a single logic gate or update a variable, you usually had to ship an entire class file or a whole agent. This approach was problematic for resource-constrained environments like early PDAs and cell phones, where bandwidth was expensive and memory was scarce. Furthermore, updating running systems often required a full restart.
XMILE (XML-based Incremental Code Mobility) addresses these challenges by introducing a system for "fine-grained" code mobility. By representing code as XML documents and using XPath for surgical updates, the system enables efficient, incremental software management.
System Architecture and Methods
The core innovation of XMILE is leveraging XML technologies to treat code as a structured, addressable tree. Instead of compiled bytecode, code is represented as XML. An XML Document Type Definition (DTD) acts as a formal grammar, and an XML document instance acts as the program's Abstract Syntax Tree (AST).
Basic XML Mobility
In the basic model, an XML document representing the code is sent from a source host to a destination host. The destination host contains an interpreter and the corresponding DTD to execute the code.
Fine-Grained Incremental Updates
Because XML is hierarchical, the "unit of mobility" can be as small as a single XML element (a statement or a variable). To update a remote program, XMILE sends an "increment" (the new code fragment) along with "directions" written in XPath. The remote interpreter uses these XPath directions to find the exact node in the existing code tree and swap it out or insert the new fragment.
This "surgical precision" allows for updates without replacing entire files. Instead of a 100KB class file, a 100-byte XML fragment and an XPath string can patch a running system on the fly.
Key Results
The authors developed a prototype implementation of the XMILE system, demonstrating several key capabilities:
- Feasibility of Fine-Grained Units: The system successfully decomposed code mobility down to the statement level.
- Dynamic Patching: The prototype supported the incremental insertion and substitution of code fragments into a running interpreter without requiring a full reboot.
- Mobile Device Compatibility: Evaluation using the Symbian EPOC RE5 emulator confirmed the approach's relevance for the mobile thin clients of the era.
Limitations and Future Work
While XMILE offers significant flexibility, it introduces new challenges. XML parsing and tree manipulation are computationally more expensive than executing binary code, leading to performance overhead. Additionally, the initial prototype was constrained by the rigidity of DTDs; the authors suggested moving toward XML Schemas for more flexible and complex language definitions. Finally, ensuring state consistency during "no-stop" updates—where code is swapped while the interpreter is active—remains an area for further research.
Summary updated