Towards just-in-time middleware architectures

Charles Zhang, Dapeng Gao, Hans-Arno JacobsenAOSD 2005 · DOI

TL;DR

This paper introduces "Just-in-time Middleware" (JiM), a novel paradigm that automatically synthesizes middleware architectures based on the specific needs of an application, rather than relying on pre-built, often over-engineered solutions. This approach leads to more flexible, efficient, and tailored middleware, demonstrated through their prototype system, Abacus.

What Problem Does This Paper Address?

Building distributed applications relies heavily on middleware (like CORBA, .NET Remoting, Web Services) to handle complexities like different hardware, operating systems, and communication protocols. However, traditional middleware is often designed and packaged before applications are developed. This "pre-postulated" approach leads to several problems:

  • Impedance Mismatch: Pre-built middleware might be too generic (overfitting) or lack necessary features (underfitting) for a specific application's domain.
  • Application Obliviousness: Existing middleware doesn't effectively leverage the rich information embedded within user applications about their specific middleware feature requirements.
  • Domain Limitations: Middleware designed for one domain often struggles to support applications in other domains without significant re-implementation.
  • Excessive Configurability: While some middleware offers configuration, it can be overwhelming and still doesn't guarantee a perfectly tailored solution.

The authors argue that this inflexibility hinders the ability to create truly adaptive middleware that meets the ever-evolving demands of distributed systems.

Methods

The core of the paper is the Just-in-time Middleware (JiM) paradigm, which reverses the traditional middleware construction process. Instead of pre-building middleware, JiM synthesizes it after understanding the application's needs. This process involves several key stages:

  1. Acquisition: Gathering functional requirements for the middleware. This is done through:
  2. Explicit Acquisition: Analyzing service declarations (like IDL) and the application's source code to identify intended middleware features.
  3. Rule-based Inference: Using functional dependency rules to automatically infer and include necessary features to satisfy explicit requirements. This stage aims for a "minimum superset" of the explicitly acquired features.
  4. Targeting (Inference & Verification):
    • Inference: The system reasons about functional dependencies to ensure all required features are included. It uses a cost model to select the most appropriate features when multiple options exist, aiming for minimalism.
  5. Verification: The inferred middleware manifest is checked against composition constraints (e.g., platform limitations like J2ME not supporting certain data types). Violations can trigger re-acquisition.
  6. Synthesis: Generating the tailored middleware implementation. This stage is guided by:
  7. Convolution Descriptions: Rules that define how different middleware features interact, ensuring that only the necessary parts of a feature's implementation are included based on its context.
  8. Packaging Schema: A structured way to organize middleware code (functional implementation, interaction logic) to facilitate the selection of correct components.
  9. Aspect-Oriented Programming (AOP): The authors heavily leverage AOP (specifically AspectJ) to modularize crosscutting concerns and enable fine-grained composition.

Their prototype, Abacus, implements this JiM paradigm by refactoring the ORBacus CORBA implementation into aspects. The Arachne synthesizer integrates the aspect-aware IDL compiler, source code parser, and inference engine.

Datasets

Not explicitly discussed in terms of "datasets" in the traditional machine learning sense. The paper uses:

  • ORBacus: An industrial-strength CORBA implementation, which is refactored to create the Abacus prototype.
  • UMessenger: A custom-built ubiquitous messenger application designed to run across diverse environments (embedded J2ME, desktop J2SE, enterprise). This serves as a benchmark for evaluating JiM's cross-domain adaptability.
  • Randomized Feature Selections: The authors simulate various real-world usage scenarios by randomly selecting features for the middleware, generating ten valid configurations from fifteen randomized runs.

Key Insights and Ideas

  • Shifting Middleware Construction: The core idea of "post-postulating" middleware (synthesizing it based on application needs at or near runtime) is a significant departure from traditional approaches.
  • Aspects as Enablers: Aspect-oriented programming is crucial for achieving the high degree of modularity and fine-grained composition required for JiM. It allows for separating crosscutting concerns and weaving them into the middleware core.
  • Minimalism Through Inference: The inference engine's goal of producing a "minimum superset" is key to avoiding the bloat of pre-built middleware. This is achieved by satisfying dependencies while minimizing included features.
  • Convolution is Key: Explicitly defining how features interact ("convolution descriptions") is essential for correct synthesis, ensuring that only relevant code is included when features are combined.
  • Versatility Across Domains: The JiM approach, as demonstrated by Abacus, can effectively tailor middleware for vastly different environments (from resource-constrained embedded systems to enterprise platforms) without sacrificing functionality or introducing unnecessary overhead.

Key Results

The evaluation of Abacus demonstrated significant improvements over the original ORBacus:

  • Static Properties: Synthesized ORBs were considerably smaller. For example, the J2ME configuration resulted in an ORB that was 42% of the original size. Coupling metrics (efferent and afferent) were also significantly lower, indicating reduced complexity.
  • Runtime Properties:
    • Payload Transportation: Synthesized ORBs showed roughly equivalent response times to the original ORB in regular JVM environments, with virtually no apparent overhead from the AspectJ runtime.
  • Resource Usage: Abacus exhibited an average of 24% reduction in memory usage compared to the original ORB. Cache miss rates (L1 and L2) also showed reductions.
  • Randomized Customization: Synthesized ORBs were consistently between 56% and 75% of the original ORB's size, with reduced coupling. Runtime metrics also showed improvements in memory usage and cache performance.

Limitations and Future Work

  • Current Focus: The current JiM discussion and implementation are primarily focused on the development time and remote-procedure-call (RPC) based middleware.
  • Future Work:
    • Load-time Weaving: Exploiting load-time weaving capabilities of AspectJ to postpone synthesis further, potentially allowing for cost functions that consider runtime memory usage.
  • Broader Middleware Support: Extending JiM to support a wider range of middleware types and properties beyond RPC.
  • Generative Approaches: Investigating how generative programming techniques (like Model-Driven Architecture - MDA) can benefit JiM.
  • Runtime Customization: Exploring "later-time" just-in-time customizations for both vertical and horizontal dimensions, beyond the current development-time focus.
  • New Implementations: Further validating the JiM approach with new implementations and case studies across more diverse middleware features and application domains.

Summary updated

BibTeX
@inproceedings{zhang2005towards,
  author = {Charles Zhang and Dapeng Gao and Hans-Arno Jacobsen},
  title = {{Towards just-in-time middleware architectures}},
  booktitle = {AOSD},
  year = {2005},
  doi = {10.1145/1052898.1052904},
}

Loading related content...

Figure