Implementing incremental code migration with XML

Wolfgang Emmerich, Cecilia Mascolo, Anthony FinkelsteinICSE 2000

Abstract

This paper explores a transition in distributed systems research from monolithic mobile code to flexible, structured data-driven architectures. The authors propose "incremental code migration" using XML to transmit statement-level updates to remote applications. By leveraging XML, XPointer, and the Document Object Model (DOM), they achieve fine-grained mobility suitable for bandwidth-constrained environments and dynamic logic updates on thin clients.

Introduction: The Limitations of Coarse-Grained Mobility

In the early 2000s, code mobility was primarily synonymous with Java. While Java allowed moving executable code across networks, it was "coarse-grained," requiring the transfer of entire classes or objects. This approach faced significant challenges in the mobile computing landscape of the time:

  1. Bandwidth Constraints: Transferring compiled Java byte-code over slow connections (e.g., 9,600 baud GSM) was inefficient.
  2. Scalability: Synchronizing thousands of clients with frequent updates was difficult if every change necessitated a full download.
  3. Inflexibility: Modifying a single line of logic or a UI element required a complete redeployment effort.

Methodology: XML as an Abstract Syntax Tree

The researchers propose treating XML not just as a data format, but as a representation of a program's Abstract Syntax Tree (AST). This approach utilizes three core technologies to enable incremental updates:

  • XML & DTDs: Document Type Definitions (DTDs) define the "grammar" of a programming language. An XML document serves as a valid "program" that can be executed by a remote interpreter.
  • XPointer: This technology enables "surgical precision" for updates, identifying specific nodes in the remote program's tree structure for modification rather than replacing the entire file.
  • DOM (Document Object Model): Remote hosts use DOM operations to dynamically insert, delete, or replace nodes in the running program's AST upon receiving an update.
DTD defining the grammar for the Karel the Robot language

To prove the concept, the authors implemented an interpreter for a toy language called "Karel the Robot," using Java RMI to ship XML snippets and XPointer instructions between hosts.

Evaluation and Application Domains

The system was evaluated across three distinct application domains to showcase its versatility:

  1. Karel the Robot: A simple instruction set used to demonstrate how a robot's pathing logic can be changed mid-operation.
  2. XwingML: A DTD for describing Java Swing user interfaces. This showed how UI descriptions could be sent as small XML fragments rather than heavy compiled code.
  3. Distributed Consistency Management: A system for checking rules across distributed UML documents, where the rules themselves are migrated as XML increments to avoid central bottlenecks.

Key Results: Efficiency and Dynamic Reconfiguration

The approach proved highly efficient in terms of bandwidth. The authors qualitatively demonstrated that XML fragments for UI changes (XwingML) were significantly smaller than equivalent Java byte-code. More importantly, the authors successfully demonstrated "hot-swapping" logic—replacing commands within a running interpreter without interruption.

Visual comparison of robot behavior before and after an incremental code update

The Karel interpreter was remarkably lightweight, implemented in approximately 50 lines of Java code, proving that XML-based interpretation is feasible for the "thin clients" (like PDAs) of the era.

Discussion: Insights and Limitations

A key insight from this research is that code mobility exists on a spectrum; XML allows the unit of mobility to be decomposed from an entire agent down to a single statement. By using standard XML tools, building mobile-code-capable languages becomes more accessible than developing new virtual machines from scratch.

However, several limitations were identified:

  • Performance: Interpreting XML-based ASTs is slower than executing compiled byte-code, prioritizing flexibility over raw speed.
  • Security: Remote AST updates introduce significant risks; managing access control for multiple parties remains a complex, unsolved problem.
  • State Management: Updating code during complex execution (e.g., inside loops) is difficult and currently limited to simple languages.

Future work aims at "proactive" mobility, where the XML code itself contains instructions (like a <go/> tag) to move between hosts.

Summary updated

BibTeX
@inproceedings{emmerich2000implementing,
  author = {Wolfgang Emmerich and Cecilia Mascolo and Anthony Finkelstein},
  title = {{Implementing incremental code migration with XML}},
  booktitle = {ICSE},
  year = {2000},
  doi = {10.1145/337180.337227},
}
Figure