Virtual Machine Callback Aspect Weaving
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traditional aspect-oriented programming systems are inflexible as they can only apply aspects at well-defined points in the code evaluated by the virtual machine, limiting their ability to dynamically incorporate crosscutting concerns into modular applications.
Innovation Solution
Implementing aspects via callbacks within a virtual machine allows for dynamic weaving of aspect code at any point during execution, including conditional statements, method calls, and exception handlers, without modifying the intermediate code, thereby enhancing flexibility.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If traditional aspect-oriented programming systems are used, then aspects can be applied at well-defined points in the code, but the system becomes inflexible and cannot dynamically incorporate crosscutting concerns
Solution Approach 1:
The patent implements dynamic aspect application by allowing aspects to be applied at any point during virtual machine execution rather than being fixed at well-defined points. The aspect weaver can dynamically insert aspect code at conditional statements, method calls, or exception handlers during runtime, making the system adaptable to different execution contexts without requiring complex pre-defined weaving points.
Solution Approach 2:
The patent introduces an intermediary mechanism where the virtual machine itself acts as the mediator between aspect code and application code. Instead of requiring specialized loaders or code modification, the virtual machine executes aspect code as callbacks that can be invoked at any execution point, simplifying the overall system architecture while maintaining high flexibility.
2Adaptability or versatility
If aspects are applied by modifying intermediate code, then crosscutting functionality is incorporated, but the virtual machine operation cannot be directly changed
Solution Approach 1:
The patent inverts the traditional approach by not modifying the intermediate code to change virtual machine behavior, but rather keeping the intermediate code static and changing the virtual machine's operation through callback mechanisms. The virtual machine is enhanced to execute aspect code as callbacks that can be invoked at any point, allowing direct control over virtual machine behavior without code modification.
Solution Approach 2:
The patent replaces the mechanical code modification approach with a callback-based mechanism. Instead of modifying intermediate code structure, the system uses callback functions that the virtual machine executes at appropriate points, substituting the mechanical process of code modification with a more flexible functional approach that directly controls virtual machine operation.
3Ease of operation
If specialized loaders are used to insert aspect code, then aspects can be woven into application code, but the system requires additional complexity and cannot operate without specialized components
Solution Approach 1:
The patent implements self-service by enabling the virtual machine to handle aspect code execution independently without requiring external specialized loaders. The virtual machine is enhanced to directly execute aspect code as callbacks at any execution point, allowing the system to serve itself by integrating aspect functionality into the core virtual machine operation rather than relying on separate specialized components.
Data Source
AI summary
Implementing aspects via callback in a virtual machine, where an aspect weaver weaves the aspect with a module to provide primary and crosscutting functionality in the runtime execution of the module. The virtual machine has multiple modules that are part of an application implementing separation of concerns. Each of the multiple modules has a distinct functionality portion and a common functionality portion, common to all modules. The common functionality is referenced by the virtual machine via callback for the multiple modules. Aspect code is loaded as a callback that is applied to the multiple modules by the virtual machine. Loading the aspect code as a callback can implement the aspect at any point in the modules, including conditional statements, calls to methods of objects or classes, loops, any point in an exception handler, or to monitor changes in variables.
