Classloader Hierarchy for Mobile App Compatibility
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Mobile applications face compatibility issues due to the exponential increase in library versions, leading to difficulties in identifying and retrieving correct classes, which can result in application failures when incompatible classes are loaded.
Innovation Solution
A computing platform creates a framework-defined classloader and a framework-termination classloader to manage conflicting classes, replacing the application classloader using reflection, and transmitting these classloaders to a user device to ensure correct class retrieval and prevent application failures.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If multiple versions of libraries are loaded to support complex mobile applications, then the functionality and versatility of the application increase, but the difficulty of identifying and retrieving correct classes increases, leading to compatibility issues and application failures
Solution Approach 1:
The patent segments the classloader system into multiple hierarchical levels: application classloader, framework-defined classloader, and framework-termination classloader. Each segment has a specific responsibility for loading classes from different library versions, allowing the system to manage multiple library versions without confusion by directing class retrieval to the appropriate segment based on the class name hierarchy.
Solution Approach 2:
The framework-defined classloader acts as an intermediary between the application classloader and the framework-termination classloader. It intercepts class loading requests, determines whether the class exists in framework libraries, and either loads the class from the appropriate framework version or delegates to the termination classloader, thereby mediating the conflict between different library versions.
2Speed
If the application classloader directly retrieves classes from available libraries, then the class retrieval process is simple and fast, but the application may retrieve incompatible classes from wrong library versions, causing application failures
Solution Approach 1:
The patent implements preliminary action by pre-defining the classloader hierarchy and establishing the delegation protocol before any class retrieval operations occur. The framework-defined classloader is pre-configured with knowledge of framework library locations and version mappings, so when class retrieval is requested, the system can immediately determine the correct source without trial-and-error searching, maintaining speed while ensuring compatibility.
3Device complexity
If a single classloader system is used to manage all classes, then the system structure is simple, but it cannot manage conflicting classes from different library versions, leading to compatibility issues
Solution Approach 1:
The patent applies the nested doll principle by creating a nested hierarchy of classloaders where the framework-defined classloader is nested within the application classloader's delegation path, and the framework-termination classloader is nested as a parent. This nested structure allows each classloader to operate within its specific scope while maintaining access to outer layers when needed, enabling complex framework management within a structured hierarchy that appears simple from the application's perspective.
Data Source
AI summary
Methods and systems for accessing conflicting frameworks and classes are presented. In some embodiments, a conflicting frameworks computing platform may receive an application classloader corresponding to a mobile application. The application classloader may indicate one or more child application-defined classloaders. Subsequently, the conflicting frameworks computing platform may create a framework-defined classloader comprising a first class that conflicts with a second class in the one or more child application-defined classloaders. Further, the conflicting frameworks computing platform may create a framework-termination classloader. The framework-termination classloader may be a parent classloader of the framework-defined classloader. Next, the conflicting frameworks computing platform may replace, using a reflection function, the application classloader with a new application classloader. The new application classloader may indicate the one or more child application-defined classloaders, the framework-defined classloader, and the framework-termination classloader.


