Modular co-versioning in a dynamically linked runtime environment
Through a modular common version management system, multi-version libraries are used to load different versions of classes in the runtime environment, which solves the problem of supporting multiple software platform versions in the existing technology and achieves effective utilization of new features and backward compatibility. , reducing library maintenance and distribution costs.
Patent Information
- Application Number
- CN202110269193.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2016-02-10
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2036-02-10
AI Technical Summary
Existing technology is difficult to effectively utilize new features in supporting multiple software platform versions, causing library and framework developers to delay the use of new features, affecting user upgrades and adoption of new features, and forming cycle barriers.
Adopt a modular common version management system, load different versions of classes in the runtime environment through multi-version libraries, support the compatibility of multiple software platform versions, allow multi-version libraries to be used within a single distribution unit, and decouple the use of new features and user upgrade requirements.
It achieves the ability to use new features on newer platforms while maintaining backward compatibility, reducing library maintenance and distribution costs, and avoiding user misdirection and confusion of multi-version libraries.
Smart Images

Figure CN113050954B_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with application number 201680002397.5, application date February 10, 2016, and invention name “Modular common version management in a dynamically linked runtime environment”. Background Art
[0002] Third-party libraries and frameworks are typically required to support a range of software platform versions, often going back several versions. This often means that developers often do not take advantage of features available in newer versions of the software platform, because it is often difficult to express conditional platform dependencies (i.e., to reflectively test and activate methods that may not be present in all supported platform versions). Instead, distributing multiple library versions to support different underlying platform versions can be expensive (e.g., in terms of development time and distribution media). This can create barriers for library and framework developers to use new features, which in turn can become a barrier for users to upgrade to new platform versions, which itself creates barriers for developers to support features of newer platform versions - creating a cycle that can hinder the adoption and improvement of new features.
[0003] Software platforms are generally versioned in a backwards-compatible manner so that older applications can run on newer platform versions. However, software libraries often depend on a certain version of the underlying platform. Therefore, library developers may want to have the library run on an older platform version on the one hand, but may also want to use features from a newer platform version on the other hand. Therefore, software library developers often delay using newer platform features until they can require a newer platform version (and therefore may not be backwards compatible with older platform versions). In addition, software library developers may distribute multiple versions of the library in order to be backwards compatible for some users and support newer platform features for other users. Summary of the invention
[0004] Described herein are various embodiments of systems and methods for modular co-versioning in a runtime environment for dynamic linking (e.g., runtime linkable). According to the modular co-versioning described herein, a multi-version library including multiple versions of a class can be created. According to various embodiments, the multi-version library can include a base version and one or more other versions, each of which can correspond to a specific corresponding version of a software development kit, a runtime environment, or a software platform. Therefore, according to some embodiments, the multi-version library described herein can be a library of versions of multiple versions that can utilize the underlying runtime within a distribution unit.
[0005] At runtime, the multi-version library can be searched to load the version of the class corresponding to the version of the currently executing runtime environment or platform or the version of the software development kit used to develop the currently executing environment / platform. If the multi-version library does not include the version of the class corresponding to the currently executing version of the environment / platform, the version of the class corresponding to the previous version of the environment / platform (and / or software development kit) can be found in the multi-version library and loaded. As an alternative, if the subsequent version of the class is not found in the multi-version library, the base version of the class can be loaded from the multi-version library.
[0006] Thus, the modular common versioning described herein may allow library developers to provide multiple versions of a class to support multiple versions of a runtime environment, software platform, or software development kit without maintaining multiple different libraries and / or deliverables. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 is a logical block diagram illustrating a multi-version library implemented using the modular common version management described herein according to one embodiment.
[0008] Figure 2 is a logical block diagram illustrating a class loader configured to load classes from a multi-version library according to modular common version management in one embodiment.
[0009] Figure 3 is a flow chart illustrating one embodiment of a method for loading a class from a multi-version library according to modular common version management as described herein.
[0010] Figure 4 is a logical block diagram illustrating a Java-based multi-version library implemented according to modular common version management in one embodiment.
[0011] Figure 5 is a logical block diagram illustrating one embodiment of a multi-version library according to modular common version management as described herein that does not include a version of each class in each folder.
[0012] Figure 6 is a logical block diagram illustrating a software development system configured to implement modular common version management according to one embodiment.
[0013] Figure 7 is a flow chart illustrating one embodiment of a software development system for generating a multi-version library as described herein.
[0014] Figure 8 is a logical block diagram illustrating an example computer system suitable for implementing modular common version management according to one embodiment. DETAILED DESCRIPTION
[0015] Various embodiments of the system and method for realizing modular common version management described herein.For example, a library often depends on a certain version of the underlying platform, such as requiring a specific (or newer) version of a software platform or runtime environment. A library developer may wish to have a library that runs on an older platform version, but may also wish to use features from a newer platform version. The modular common version management described herein can provide development and / or software encapsulation methods so that a dynamically linked platform (e.g., a linkable platform at runtime) allows the creation and distribution of a multi-version library.
[0016] The modular co-versioning described herein can be viewed as breaking the coupling between the ability to take advantage of features from newer platform versions and the loss of backward compatibility caused by requiring all users to upgrade to the newer version. Library and framework developers can maintain and distribute a single multi-version product (e.g., a software library) that is able to take advantage of new features (or cope with the absence of removed features) when executed on newer underlying platforms without requiring all users to upgrade (which would reduce the potential users of their library, and therefore reduce the market for the library).
[0017] In some embodiments, modular co-versioning includes the creation of multi-version libraries. For example, in a Java-based system, modular co-versioning can utilize a multi-version Java Archive (JAR) format developed with a Java Software Development Kit (JDK), where a JAR file can appear as a normal (e.g., single-version) JAR file to an older runtime environment (e.g., an older JRE), but can also include additional "hidden" folders (e.g., in a META-INF / modules folder) that the older runtime environment may ignore.
[0018] However, a runtime environment or software development tool configured to support modular co-versioning can utilize additional information in a multi-release Java (JAR) file to support modular co-versioning. Figure 1 is a logical block diagram illustrating a multi-version library implemented using modular common version management as described herein, according to one embodiment.
[0019] like Figure 1As shown, multi-version library 100 may include multiple versions of a class. For example, class 110 may represent a common, base, or root version of a class (e.g., a version of a class that can be used by multiple supported versions of a software development kit and / or runtime environment). In addition, classes 120A, 120B, and 120C may represent different versions of a class (e.g., some or all of the same class represented by class 110) supported by corresponding versions of the software development kit and / or runtime environment. In some embodiments, multi-version library 100 may include metadata 130 that indicates and describes the existence of multiple versions of a class implemented according to modular common version management, which will be described in more detail below.
[0020] For example, in a Java-based example, a multi-release JAR file could include additional directories with classes, as shown below:
[0021] JAR Files
[0022] -Directory root -- for classes in JDK 7 and earlier
[0023] -META-INF
[0024] -8
[0025] -Classes that require JDK>=8
[0026] -9
[0027] -Classes that require JDK>=9
[0028] -10
[0029] -Classes requiring JDK>=10
[0030] As shown above, an example JAR file may include multiple versions of the same class for different versions of a runtime environment supported by a specific version of a software development kit such as the Java Development Kit (JDK). Figure 1 As shown, multi-version library 100 can represent a Java-based multi-version JAR file, which, according to an example embodiment, can include a base version of a class such as class 110 in a directory root portion, while including other versions of the class represented by classes 120A, 120B, and 120C, respectively, in JDK 8, JDK 9, and JDK 10 portions. In some embodiments, all versions of a particular class can have the same class signature. That is, all versions of a particular class will be considered binary compatible and can correspond to the same class signature. Therefore, in some systems, loading two different versions of the same class will be erroneous or impossible.
[0031] In general, a class can be considered as a user-defined type or data structure that can include data, variables, functions, methods and / or other attributes as members, and represents a definition, design or template for creating a specific type of programming object. A class can provide initial values for data members and provide implementations for member functions and methods. Classes are often included in libraries. A library can be considered as a collection of resources used by a software program or application. According to some embodiments, a library can include any of various types of resources, including but not limited to: data, documents, classes, subroutines and / or type specifications. A library can be organized so that it can be used by more than one application (possibly at the same time), and reusability can be improved by providing resources so that applications do not have to implement (or reimplement) the same behavior.
[0032] When running on different runtime environments (e.g., runtime environments corresponding to different versions of software development kits), different versions of classes can be loaded from multi-version library 100 (e.g., multi-version JAR in the above example). Figure 1 As shown, class 110 may correspond to software development kit 140 (e.g., a particular version of the software development kit) (and support features thereof), while classes 120A, 120B, and 120C may correspond to software development kits 150A, 150B, and 150C (e.g., corresponding versions of the software development kit), respectively (and support features thereof).
[0033] It should be noted that, although the description herein is mainly based on Java-based systems, according to different embodiments, module common version management can also be applied and / or used for software development (and execution) systems that are not (or not exclusively) based on Java. In addition, in some embodiments, the multi-version library 100 can represent a runtime linkable library, such as a JAR or a dynamically linked library (DLL).
[0034] At runtime, the runtime environment (or the class loader module of the runtime environment) can load a class from a multi-version library 100 (e.g., a multi-version JAR) file by first determining whether the multi-version library 100 includes a version of the class that corresponds to the version of the runtime environment (e.g., the version being executed). If the multi-version library 100 includes the version, the runtime environment can load the specific version of the class (e.g., the class loader of the runtime environment can load the class). In the Java-based example above, a runtime environment based on JDK version 10 can load one version of a class (e.g., from class 120B), while a runtime environment based on JDK version 9 can load a different version of the class (e.g., from class 120C).
[0035] Therefore, multi-release libraries (e.g., multi-release JARs) can be thought of as comprising the overall amount to the classpath. Figure 2 2 is a logical block diagram illustrating a class loader configured to load classes from a multi-version library according to modular common version management in one embodiment. For example, in one embodiment, a class loader 210 executing within a runtime environment 200 may load a class by first searching for the class from class 120C of the multi-version library 100, as indicated by arrow 220. If a suitable version of the class is not found within class 120C, the class loader 210 may be configured to then search for a version of the class within class 120B, as indicated by arrow 230. Similarly, if a suitable version of the class is not found within class 120B, the class loader 210 may be configured to search for the class in class 120A, as indicated by arrow 240. If class loader 210 cannot find a suitable version of the class in any version-specific area of multi-version library 100 (e.g., classes 120A, 120B, and 120C), class loader 210 can be configured to load a base version of the class from class 110, as shown by arrows 250 and 260.
[0036] In a Java-based example, at runtime, a class loader configured to implement modular common version management and running on JDK version 10, such as class loader 210, may search the contents of the overall constituent class path, including classes specific to version 10 (e.g., class 120C), then classes specific to version 9 (e.g., class 120B), then classes specific to version 8 (e.g., class 120A), and then classes in the directory root (e.g., class 110). Similarly, a class loader executing on JDK version 9 may first search for classes specific to version 9 (e.g., class 120B), then classes specific to version 8 (e.g., class 120A), and then directory root classes (e.g., class 110), without searching for classes specific to version 10 (because version 10 is later than the currently executing version 9 in this example). In addition, according to some embodiments, a class loader that is not configured to utilize modular common version management may only see the directory root class (e.g., class 100) (and thus can only load classes from the directory root class). So, for example, if JDK versions 8, 9, and 10 all support modular common versioning and JDK version 7 does not, a single multi-version library can support JDK versions 7 through 10 (e.g., the class loader for version 7 can read the base version of a class, while the class loaders for versions 8 through 10 can each utilize their corresponding version-specific classes).
[0037] Figure 3 1 is a flow chart illustrating one embodiment of a method for loading a class from a multi-version library according to modular common version management as described herein. Figure 3As shown, a class loader executing in a runtime environment (such as a class loader 210 executing in runtime environment 200) can load a class from a runtime-linkable multi-version library (such as multi-version library 100) at runtime, which is configured to include multiple versions of a class according to modular common version management as shown in block 300. As described above and as shown in block 310, the class loader can determine whether the multi-version library includes a version of the class corresponding to a current version of a software development kit, and the current version of the software development kit is used to implement software that can be executed in the corresponding current version of the runtime environment. For example, according to one embodiment, the class loader 210 can determine whether the multi-version library 100 includes a version of the class corresponding to a version of the software development kit, and the version of the software development kit is used to develop software for the same version of the runtime environment 200, where the class loader is currently executing on the same version of the runtime environment 200. In some embodiments, class loader 210 may not search for a version of a desired class (e.g., a class to be loaded) that corresponds to the "latest" version of the software development kit, because class loader 210 may not be developed in or executed within a runtime environment that corresponds to the "latest" version. Instead, according to some embodiments, class loader 210 may begin searching for the class in a region of multi-version library 100 that includes classes that correspond to the same version of the software development kit that the class loader is currently executing (or was developed with in the past).
[0038] In response to determining that the multi-version library contains a version of the class that is associated with the current version of the software development kit, as indicated by an affirmative output of decision block 320, the class loader can load the version of the class that is associated with the current version of the software development kit from the multi-version library, as indicated by block 330. For example, as described above, if class loader 210 finds a suitable version of the class in class 120C, class loader 210 can then load this version of the class from multi-version library 100.
[0039] However, in response to determining that the multi-version library does not include a version of the class associated with the current version of the software development kit, as indicated by a negative output in decision block 320, the class loader can determine whether the multi-version library includes a version of the class corresponding to a previous version of the software development kit, as indicated by block 340. For example, class loader 210 can be configured to search for a version of the class in class 120B in response to determining that the multi-version library 100 does not include a version of the class in class 120C. In a Java-based example, according to one embodiment, a class loader corresponding to JDK9 can determine whether the multi-version JAR includes a JDK 8 version of a particular class in response to determining that the multi-version JAR does not include a JDK 9 version of the class.
[0040] In response to determining that the multi-version library contains a version of the class that corresponds to the previous version of the software development kit, as indicated by the affirmative output of decision block 350, the class loader can load the version of the class that corresponds to the previous version of the software development kit from the multi-version library, as indicated by block 360. For example, according to one embodiment, class loader 210 can be configured to load the class from class 120A in response to determining that multi-version library 100 includes a version of the required class in class 120A. In a Java-based example, a class loader corresponding to JDK9 can load the JDK8 version of a particular class in response to determining that the multi-version JAR does not contain a JDK9 version of the class and in response to determining that the multi-version JAR includes a JDK8 version of the class.
[0041] Similarly, in response to determining that the multi-version library does not include a version of the class corresponding to the previous version of the software development kit, as indicated by a negative outcome of decision block 350, the class loader can be configured to load a base version of the class from the multi-version library, as indicated by block 370. For example, according to one embodiment, class loader 210 can be configured to load a class from class 110 in response to determining that multi-version library 100 does not include a version of the required class in any of classes 120C, 120B, or 120A. In a Java-based example, a class loader corresponding to JDK 9 can load a base version of a class in response to determining that the multi-version JAR does not include a version of a particular class corresponding to JDK versions 8, 9, or 10.
[0042] Therefore, in some embodiments, modular common version management can allow library developers to create and distribute a single library that is both backward compatible with older runtime environment versions and capable of supporting subsequent features provided in newer versions of the runtime environment. Users executing an older version of the runtime environment can use the same library as users executing a newer version of the runtime environment. Therefore, library developers may not have to distribute multiple versions, thereby potentially preventing users from being confused (e.g., users will not accidentally download and install the wrong version of the library). In addition, library developers may not have to require all users to upgrade to the newer version of the runtime environment.
[0043] In addition, a multi-version library may not include multiple versions of each class. Conversely, a multi-version library may include multiple versions of some classes but not multiple versions of other classes. In addition, a multi-version library may include the same number of versions of each class. For example, according to some embodiments, a multi-version library may include a class with a smaller number of versions than another class.
[0044] According to various embodiments, modular common version management can be implemented in different ways and used for different systems. For example, a Java-based example of modular common version management may include a multi-version JAR file (e.g., a multi-version library 100), which may include: a directory root folder (or area, or portion) containing a base version of a class and / or resource, and a META-INF folder (or area, or portion) including metadata about the JAR, the metadata including information about additional versions of the class and / or resource. For example, according to one embodiment, the multi-version library 100 may include a class 110 representing a directory root folder and metadata 130 representing a META-INF folder. In other embodiments, the multi-version library 100 may be implemented in a non-Java software programming language (e.g., such as C, C++, etc.).
[0045] By including versioning metadata about specific groups of files, a multi-version library supporting modular co-versioning can compatibly encode (eg, include) multiple versions of the library for different underlying platform versions (eg, compatible with multiple versions of a software development kit).
[0046] As described above, a multi-version library may include additional folders for code (e.g., classes and / or resources) that is specific to a particular version of a software development kit (and / or runtime environment). For example, in a Java-based example, a multi-version JAR (MVJAR) may include additional folders for code that is specific to a particular Java Development Kit (JDK) version. Thus, an example JAR for a typical library may look like the following (e.g., without support for multiple versions):
[0047] jar root
[0048] –A. Class
[0049] – Class B
[0050] –C.Class
[0051] – Class D.
[0052] Furthermore, according to an example embodiment, if there are alternate versions of class A and class B (e.g., the alternate version utilizes features of version 8, and another version of class A utilizes features of 9), they can be included in a multi-release JAR as follows:
[0053] jar root
[0054] –A. Class
[0055] – Class B
[0056] –C.Class
[0057] – Class D.
[0058] –META-INF
[0059] -Version
[0060] -8
[0061] -A. Class
[0062] -B.Class
[0063] -9
[0064] -A. Class
[0065] Figure 4 is a logic block diagram showing a Java-based example of a multi-version library in one embodiment, which is implemented with modular common version management according to the above example. Figure 4 As shown, the multi-version library 100 can represent a Java-based multi-version JAR in one embodiment, and the multi-version library 100 can include a root area or folder 400 containing base versions of classes and a META-INF area or folder 410 containing information about additional versions of classes. For example, the root folder 400 can include base versions of classes A, B, C, and D, as shown in blocks 440A, 450A, 460, and 470. In addition, the META-INF folder 410 can include two folders, such as 420 and 430, which include classes specific to version 8 and version 9 of the JDK, respectively, as shown in blocks 440B, 450B, and 440C. Therefore, in Figure 4 In the example based on Java above, blocks 440A, 440B and 440C may represent three different versions of class A, and blocks 450A and 450B may represent two different versions of class B.
[0066] According to some embodiments, the classes in the root folder 400 may be uniquely visible (or available) to a legacy runtime environment that is not configured to support modular common version management - thereby potentially making the multi-version library 100 indistinguishable from a legacy library to a legacy runtime environment - except for the META-INF folder 410, which may be ignored by the legacy runtime environment.
[0067] In addition, in some embodiments, for a runtime environment that supports modular common version management, classes corresponding to a software development kit version that is higher than the software development kit version currently being executed can be ignored. For example, using the Java-based example described above, at runtime, folder 430 can be ignored by a runtime environment corresponding to JDK version 8 (e.g., a class loader executed within the runtime environment). Therefore, a class loader based on version 8 can search for classes in folder 420 (e.g., corresponding to the currently executed version). According to some embodiments, if a suitable class is not found, if any previous (e.g., lower) version of the JDK exists in the multi-version JAR, the class loader can search for the same class in a folder corresponding to the previous version, and if a suitable version of the class is not found in any version-specific area, the class loader can search the JAR directory root folder.
[0068] That is, according to some embodiments, corresponding to a class loader for JDK version 9, the runtime environment may search for classes in multi-version JAR files as if there were a JAR-specific class path that first included version 9 files, then version 8 files, and then the JAR root. However, on a version 8 JDK, this class path may only include version 8 files and JAR roots (e.g., it may ignore version 9 classes because version 9 classes correspond to a version later than the currently executing version).
[0069] By utilizing modular common versioning, it is possible to have a version of a class designed for a subsequent software development kit version "override" a version of the same class designed for an earlier version. In the Java-based example above, when running on a version 8 JDK configured to support modular common versioning, JDK8-specific versions of classes A and B (e.g., blocks 440B and 450B) and generic (e.g., base or directory root) versions of classes C and D (blocks 460 and 470) may be visible (and / or available). However, when running a JDK version 9 configured to support modular common versioning, a JDK 9-specific version of class A (e.g., block 440C), a JDK 8-specific version of class B (e.g., block 450B), and generic versions of classes C and D (e.g., blocks 460 and 470) may be visible. When running an older version of the JDK or running on a JDK that is not configured to support modular common versioning, only the base versions of all classes (eg, blocks 440A, 450A, 460, and 470) are visible.
[0070] Although the main aspects of the description herein are classes and class files, in some embodiments, when implementing modular common version management, resource files can be handled in the same manner as class files. That is, according to some embodiments, multiple versions of a resource can be included in a single file, and different versions can be used together using different versions of a software development kit or runtime environment. In addition, in some embodiments, the invisible classes and / or resources described herein can be visible to a class loader or runtime environment, but the class loader or runtime environment can be configured to ignore or not utilize these classes and / or resources.
[0071] In addition, when implementing modular common version management, traditional version control (e.g., as part of a software development tool) may be modified to properly handle multiple versions of classes and / or resources. For example, according to one embodiment, in a Java-based system, version control may not be applicable to metadata in a multi-version JAR file (e.g., such as declarations for main application classes and services).
[0072] In some embodiments, a multi-version library, such as a Java-based multi-version JAR, can be considered a single release unit with its own version, although it can internally represent multiple versions of the library for use on different platform (e.g., runtime environment) versions. Therefore, each version of the implementation of the multi-version library can be the same for the public API to ensure strict API compatibility. In some embodiments, this can mean that public classes that exist in version-specific folders should have corresponding versions in the root folder. However, a class does not necessarily have a version in each version-specific folder.
[0073] For example, as described in this article, Figure 5 is a logical diagram illustrating one embodiment of a multi-version library according to modular common version management that does not include a version of each class in each folder. Figure 5 The multi-version library in the above discussion Figure 4 However, according to one embodiment, Figure 5An additional version of class E is shown, represented by blocks 500 and 500A. Thus, in a Java-based example, multi-version library 100 may include a base version of class E in JAR root folder 400 (e.g., block 500A), and a version 9 version of class E in version 9 folder 430 (e.g., block 500B), without including a version 8 version of class E in version 8 folder 420. According to one embodiment, when loading class E, a class loader corresponding to version 9 JDK may be configured to find and load the version of the class in version 9 folder 430 (e.g., block 500B), while a class loader corresponding to version 8 JDK may be configured to ignore the version of the class in version 9 folder 430 and load the base version of the class (e.g., block 500A), because version 8 folder 420 does not have a version of class E.
[0074] According to some embodiments, modular common version management can enable library and framework developers to decouple the use of features from a specific software development kit (and / or runtime environment / platform) version from the requirement to migrate all users to that specific version. Instead, library and framework maintainers can gradually migrate to (and / or) support new features by using a single deliverable library (e.g., a multi-version library) while still providing support for old features.
[0075] Implementing modular common version management may include one or more development and / or runtime components. For example, software development tools such as compilers, linkers, and other library tools may be configured to create multi-version libraries. For example, in a Java-based example embodiment, the following components may be configured to implement some (or all) of the modular common version management described herein:
[0076] JAR Specifications
[0077] Class loader implementation
[0078] JAR creation tool and JAR signing tool
[0079] Compiler
[0080] One or more testing tools
[0081] Parts scanning library
[0082] And debugging tools.
[0083] For example, Figure 6 is a logical block diagram illustrating a software development system configured to implement modular common version management according to one embodiment. Figure 6As shown, according to one embodiment, compiler 600 can be configured to work with library creation tool 640 to generate multi-version library 100. Compiler 600 can compile source code 610, 620 and 630 as part of a single build function or separately to compile multiple versions of a class. For example, according to various embodiments, source code 610 can include a base version of a set of classes, while source code 620 and 630 can include versions of the same class that are configured to support corresponding versions of a software development kit or runtime environment platform.
[0084] As shown by arrows 615, 625 and 635, according to the modular common version management described herein, compiler 600 can provide the compiled version of the class to library creation tool 640, and library creation tool 640 can be configured to generate multi-version library 100, so that multi-version library 100 can include multiple versions of the class. Figure 6 The software development system shown in can be configured to compile multiple versions of a class (for example, in source code 610, 620 and / or 630), and include these multiple versions in the multi-version library 100, so that at runtime, the runtime environment / platform corresponding to different versions of the software development kit can load different versions of the class.
[0085] Although not in Figure 6 , additional software development tools and / or components may also be used or configured to implement (or help implement) modular common version management as described herein. In addition, compiler 600 and / or library creation tool 640 may be configured to utilize different versions of software development kits, libraries, build options and / or other components for different versions of classes. For example, according to various embodiments, in one embodiment, source code 610 may be compiled with a version of a software development kit that uses a set of build options, while source code 620 may be compiled with different versions of a software development kit that uses a different set of build options.
[0086] Figure 7 7 is a flow chart illustrating one embodiment of a method for creating a multi-version library according to modular common version management as described herein. As shown in block 700, a software development system can be configured to establish a multi-version library including multiple versions of a class that can be linked at runtime. In some embodiments, as described above, the multiple versions of a class can all correspond to the same class signature. For example, in one embodiment, the software development system can be configured to create and / or generate a multi-version Java archive in the Java programming language (and using other suitable software development libraries and / or tools). In another embodiment, such as Figure 6 The software development system shown in can be configured to create and / or generate multiple versions of dynamic link libraries in any of a variety of programming languages such as C, C++, or Java.
[0087] As shown in block 710, as a part for setting up a multi-version library, a software development system can be configured to store a basic version of a class in a multi-version library, and this basic version does not correspond to any specific version of the software development kit for developing a multi-version library. As mentioned above, the basic version of a class can be supported by multiple versions of a software development kit, a runtime environment or a platform or supports multiple versions of a software development kit, a runtime environment or a platform. In an example based on Java, a multi-version JAR can include a basic version of a class (for example, in the root directory area), and this basic version supports version 7, 8, 9 of a Java development kit, and therefore does not correspond to any specific version of a Java development kit. That is, the basic version of a class can be compiled using a specific version of a software development kit, but in terms of modular common version management, it may not correspond to any specific version of a software development kit (to be used to determine which version of a class is loaded at runtime).
[0088] In addition, in some embodiments, storing the base version of a class may include storing the base version of the class in a root folder or a base folder (part or other area) of the multi-version repository, where the base folder is configured to store base versions of multiple classes and does not correspond to any specific version of the software development kit (or runtime environment or platform).
[0089] like Figure 7 The illustrated method may also include storing one or more other versions of a class in a multi-version library, each version corresponding to a corresponding version of a software development kit, as shown in block 720. For example, as described above, the multi-version library 100 may include a base version of a class and multiple other versions of the same class (which may all correspond to the same class signature). For example, the multi-version library 100 may include a base version of a Java class that supports multiple versions of a Java Development Kit (JDK) and a version of the class that corresponds to version 8 of the JDK and another version of the class that corresponds to version 9 of the JDK.
[0090] In some embodiments, storing one or more other versions of a class may include storing the other versions in corresponding, version-specific folders (parts or other areas) of the multi-version library. As described above, according to some embodiments, the base version of a class may be stored in a base folder or root folder (e.g., Figure 4 400), while each other version may be stored in a version-specific folder (e.g., Figure 4 In one embodiment, storing other versions may also include storing metadata (e.g., Figure 1 and Figure 2The metadata 130 in the example includes information for identifying other versions and the specific software development kit versions to which the other versions correspond.
[0091] In addition, according to some embodiments, library developers can modify their source layout to have separate source roots for the base version and the version-specific overlay version. For example, library developers may need to modify the software build process to compile different version-specific roots at different language levels, and may also need to create multi-version libraries (e.g., using newer development tools). In addition, developers may test on different platforms (e.g., multiple versions of the runtime environment), such as testing different versions of the code that may run on different platforms.
[0092] Furthermore, in certain embodiments, instead of loading a version of a class based on a currently executing runtime environment, a currently executing software platform, and / or a software development kit, a specific version of a class may be loaded based on a preference of a user (e.g., a developer). For example, according to some embodiments, a library developer may generate and distribute a multi-version library such as multi-version library 100, and a user (e.g., a developer or programmer) of multi-version library 100 may instruct the runtime environment to ignore a preference for one or more versions of a class.
[0093] For example, in one embodiment, a user may indicate a preference to never use the latest version of a class, even when executing on a runtime environment corresponding to the latest version. For example, while a class in a multi-version library may support the latest version of a runtime environment, the code of an end user of the multi-version library (e.g., a programmer using the library) may not support it.
[0094] In addition, the user can indicate the preference that the runtime environment uses only a specific version of a class. For example, in one embodiment, the user can indicate the preference that only the base version of one or more classes in the multi-version library is used.
[0095] According to various embodiments, user preferences regarding which versions of classes in a multi-version library to use can be indicated in any of a variety of ways. For example, in one embodiment, a user can programmatically indicate preferences regarding using or ignoring one or more versions of classes in a multi-version library, such as by calling one or more methods of an API. In another embodiment, a user can use one or more global, system, and / or environment variables to indicate preferences regarding using or ignoring one or more versions of classes in a multi-version library.
[0096] In some embodiments, a user may indicate a preference on a class-by-class basis regarding which versions of a class in a multi-version library to use or ignore, while in other embodiments, such a preference may simply be a consent on a version-by-version basis. Figure 4In one embodiment, a user may have the ability to indicate a preference to ignore (e.g., never use) classes corresponding to version 9 (e.g., classes stored in folder 430), while in another embodiment, a user may have the ability to indicate a preference to not use version 8 versions of class B (e.g., represented by block 450B) but still use other version 8 versions of classes (e.g., class A represented by block 440B). According to some embodiments, indicating versions on a class-by-class basis may involve additional risks regarding compatibility that comes from executing mixed versions of classes that may not execute correctly together (e.g., one version of a class and another version of a different class).
[0097] In at least some embodiments, a computer system implementing some or all of the techniques described herein may include a general purpose computer system containing or configured to access one or more computer-readable media. Figure 8 Such a general purpose computing device 3000 suitable for implementing the methods, features, and improvements described herein is shown. In the illustrated embodiment, the computing device 3000 includes one or more processors 3010 coupled to a system memory 3020 via an input / output (I / O) interface 3030. The computing device 3000 also includes a network interface 3040 coupled to the I / O interface 3030.
[0098] In various embodiments, computing device 3000 may be a uniprocessor system including one processor 3010 or a multiprocessor system including several processors 3010 (e.g., two, four, eight, or other suitable numbers). Processor 3010 may include any suitable processor capable of executing instructions. For example, in various embodiments, processor 3010 may be a general-purpose or embedded processor implementing any of various ISAs such as x86, PowerPC, SPARC, or MIPS instruction set architectures (ISAs), or any other suitable ISAs. In a multiprocessor system, each processor 3010 may typically, but not necessarily, implement the same ISA.
[0099] The system memory 3020 may be configured to store program instructions and data that can be accessed by the processor 3010. In various embodiments, the system memory 3020 may be implemented using any suitable memory technology, such as static random access memory (SRAM), synchronous dynamic random access memory (SDRAM), non-volatile or flash type memory, or any other type of memory. In the illustrated embodiment, program instructions and data that implement one or more required functions of the methods, techniques, and data such as those described above are shown as being stored in the system memory 3020 as code (i.e., program instructions) 3025 and data 3026. For example, in one embodiment, the memory 3020 and the code 3025 and data 3026 may store program instructions and data for implementing modular common version management, including, for example, the multi-version library 100, runtime environment 200, class loader 210, compiler 600, and / or library creation tool 640 described above.
[0100] In various embodiments, one or more components configured to implement modular common version management, such as runtime environment 200, compiler 600 and / or library creation tool 640 (and / or any individual submodules therein), can be implemented in any of various programming languages or methods. For example, in one embodiment, runtime environment 200, compiler 600 and / or library creation tool 640 can be written in any of JAVA, C, C++, assembly or other general programming languages, while in another embodiment, one or more of runtime environment 200, compiler 600 and / or library creation tool 640 can be written in different more specialized programming languages. In addition, in some embodiments, runtime environment 200, class loader 210, compiler 600 or library creation tool 640 (and / or various submodules therein) may not be implemented using the same programming language.
[0101] In one embodiment, the I / O interface 3030 may be configured to coordinate I / O traffic between the processor 3010, the system memory 3020, and any peripheral devices in the device including the network interface 3040 or other peripheral interfaces. In some embodiments, the I / O interface 3030 may perform any necessary protocol, timing, or other data conversions to convert data signals from one component (e.g., the system memory 3020) into a format suitable for use by other components (e.g., the processor 3010). In some embodiments, the I / O interface 3030 may support devices connected via various types of peripheral buses, for example, various types of peripheral buses such as variations of the Peripheral Component Interconnect (PCI) bus standard or the Universal Serial Bus (USB) standard. Moreover, in some embodiments, some or all of the functionality of the I / O interface 3030, such as an interface to the system memory 3020, may be directly integrated within the processor 3010.
[0102] Network interface 3040 may be configured to allow data to be exchanged between computing device 3000 and other devices 3060 connected to one or more networks 3050. In various embodiments, network interface 3040 may support communications over any suitable wired or wireless general purpose data network, such as various types of the Internet.
[0103] In some embodiments, the system memory 3020 may be configured to store the Figure 1-7 An embodiment of a computer-readable (e.g., computer-accessible) medium for implementing the program instructions and data of the embodiments of the corresponding methods and apparatuses described. However, in other embodiments, program instructions and / or data may be received, sent, or stored on different types of computer-readable media. Generally speaking, the computer-readable medium may include a non-transient storage medium or memory medium, such as a magnetic medium or an optical medium, such as a disk or DVD / CD coupled to the computing device 3000 via an I / O interface 3030. The non-transient computer-readable storage medium may also include any volatile or non-volatile medium, such as RAM (e.g., SDRAM, DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc., which may be included in some embodiments of the computing device 3000 as a system memory 3020 or other types of memory.
[0104] In addition, the computer-readable medium may include a transmission medium or a signal such as an electric signal, an electromagnetic signal, or a digital signal, which is transmitted through a communication medium such as a network and / or a wireless link, which may be implemented through the network interface 3040. In various embodiments, such as in Figure 8Some or all of the multiple computing devices shown in the figure can be used to implement the functionality in various embodiments; for example, software components running on various different devices and servers can cooperate to provide the functionality. In some embodiments, some of the functions described can be implemented using storage devices, network devices, or special-purpose computer systems in addition to or instead of being implemented using a general-purpose computer system. The term "computing device" as used herein refers to at least all of these types of devices, but is not limited to these types of devices.
[0105] Various embodiments may also include receiving, sending or storing instructions and / or data implemented on a computer-readable medium according to the previous description. Generally speaking, a computer-readable medium may include a storage medium or memory medium, such as a magnetic medium or an optical medium, for example a disk or a DVD / CD-ROM, a volatile or non-volatile medium such as a RAM (e.g., SDRAM, DDR, RDRAM, SRAM, etc.), a ROM, etc. In some embodiments, a computer-readable medium may also include a transmission medium or a signal, such as an electrical signal, an electromagnetic signal, or a digital signal, transmitted via a communication medium such as a network and / or a wireless link.
[0106] The various methods shown in the drawings or described herein represent exemplary embodiments of the methods. These methods can be implemented in software, hardware, or a combination thereof. In the various methods, the order of the steps can be changed, and various elements can be added, rearranged, combined, omitted, or modified, etc. The various steps can be automatically executed (e.g., without being directly prompted by user input) and / or executed programmatically (e.g., according to program instructions).
[0107] Although various systems and methods are described herein with reference to and in the context of specific embodiments, it will be understood that these embodiments are illustrative and the scope of the present disclosure is not limited to these specific embodiments. Many variations, modifications, additions, and improvements are possible. For example, the blocks and logic units identified in the specification are used to understand the described embodiments, but are not intended to limit the present disclosure. For example, in some embodiments, the actions, programs, methods, tasks, or functions performed by specific components such as runtime environment 200, class loader 210, compiler 600, and / or library creation tool 640 described herein may be performed by different components, and vice versa. In addition, in various implementations of the systems and methods described herein, functions may be separated or combined in blocks differently, or described in different terms.
[0108] These embodiments are intended to be illustrative and non-restrictive. Accordingly, multiple instances for the components described herein may be provided as a single instance. The boundaries between the various components, operations, and data storage are arbitrary to some extent, and specific operations are explained in the context of specific descriptive configurations. Other functional allocations are also contemplated and may fall within the scope of the corresponding examples. Finally, the structure and function presented as separated components in the exemplary configuration may be implemented as a combined structure or component.
[0109] Although the above embodiments have been described in detail, numerous variations and modifications will become apparent once the above disclosure is fully appreciated. It is intended that the following claims be interpreted to include all such variations and modifications.
Claims
1. A computing device, comprising: processor; as well as a memory coupled to the processor, wherein the memory includes program instructions that, when executed by the processor, cause the processor to perform: Execute runtime modules within the runtime environment; loading, by the runtime module, a class from a runtime-linkable multi-version library at runtime, wherein the multi-version library is configured to include multiple versions of a class, wherein all versions of a corresponding class correspond to a same class signature for the corresponding class; wherein the runtime module is configured to load a default version of the class by default; and The loading of the class includes loading a version of the class associated with a version of the runtime environment from the multi-version library instead of the default version of the class, wherein the associated version of the class is different from the default version of the class. 2 . The computing device of claim 1 , wherein the loading further comprises loading the associated version of the class instead of the default version of the class based at least in part on the indicated preference for the associated version instead of the default version.
3. The computing device of claim 2, wherein the program instructions further cause the processor to perform determining the indicated preference based at least in part on one or more of: programmatic calls to one or more methods of an API associated with the runtime module, Global variables, system variables, or Environment variables.
4. The computing device of claim 1, wherein the loading further comprises loading the associated version of the class instead of the default version of the class based at least in part on a user preference indicating that the runtime module should ignore the default version of the class.
5. The computing device of claim 1 , wherein the program instructions further cause the processor to perform a determination as to whether the multi-version library includes the associated version of the class, wherein the loading is performed in response to a determination that the multi-version library does include the associated version of the class.
6. A computing device as described in claim 5, wherein the determining whether the multi-version library includes the associated version of the class is performed without regard to the existence of another version of the class in the multi-version library that is associated with a subsequent version of the runtime environment, wherein the subsequent version of the runtime environment occurs after the version of the runtime environment in a predefined order of runtime environment versions.
7. The computing device of claim 1, wherein to load the associated version of the class, the program instructions further cause the processor to execute loading the associated version of the class from a folder of the multi-version library, wherein the folder is configured to store versions of multiple classes.
8. A computer-implemented method comprising: loading, by a runtime module executing within a runtime environment, a class from a runtime-linkable multi-version library at runtime, wherein the multi-version library is configured to include multiple versions of a class, wherein all versions of a respective class correspond to a same class signature for the respective class; wherein the runtime module is configured to load a default version of the class by default; and The loading classes include: loading from the multi-version library a version of the class associated with a version of the runtime environment instead of the default version of the class, Wherein the associated version of the class is different from the default version of the class.
9. The computer-implemented method of claim 8, wherein the loading further comprises loading the associated version of the class instead of the default version of the class based at least in part on the indicated preference for the associated version instead of the default version.
10. The computer-implemented method of claim 9, further comprising determining the indicated preference based at least in part on one or more of: programmatic calls to one or more methods of an API associated with the runtime module, Global variables, system variables, or Environment variables.
11. The computer-implemented method of claim 8, wherein the loading further comprises loading the associated version of the class instead of the default version of the class based at least in part on a user preference indicating that the runtime module should ignore the default version of the class.
12. The computer-implemented method of claim 8, further comprising: determining whether the multi-version library includes the associated version of the class, wherein the loading is performed in response to determining that the multi-version library does include the associated version of the class; Wherein the determining whether the multi-version library includes the associated version of the class is performed without regard to the existence of another version of the class within the multi-version library that is associated with a subsequent version of the runtime environment, wherein the subsequent version of the runtime environment occurs after the version of the runtime environment in a predefined order of runtime environment versions.
13. The computer-implemented method of claim 8, wherein said loading the associated version of the class comprises loading the associated version of the class from a folder of the multi-version library, wherein the folder is configured to store versions of a plurality of classes.
14. A non-transitory computer-readable storage medium storing program instructions which, when executed on a computing device, cause the computing device to perform the method of any one of claims 8 to 13.
15. A computer-implemented method comprising: establishing, by a computing device comprising a hardware processor, a runtime-linkable multi-version library comprising a plurality of versions of a class, wherein the plurality of versions all correspond to a same class signature; The establishment includes: storing a base version of the multiple versions of the class in the multi-version library, wherein the base version of the class does not correspond to any version of the runtime environment; as well as One or more other versions of the multiple versions of the class are stored in the multi-version library, wherein each of the one or more other versions corresponds to a respective version of the runtime environment.
16. The computer-implemented method of claim 15, wherein the storing the one or more other versions of the class comprises storing metadata in the multi-version repository indicating that each of the other versions corresponds to a respective version of the runtime environment.
17. A computer-implemented method according to claim 15, wherein storing the base version of the class includes storing the base version of the class in a base folder of the multi-version library, wherein the folder is configured to store a corresponding base version of each class of one or more classes, and wherein the base folder does not correspond to any version of the runtime environment.
18. A computer-implemented method according to claim 15, wherein the storing the one or more other versions of the class includes storing each of the one or more other versions in a corresponding folder in the multi-version library, wherein each corresponding folder is associated with a corresponding version of the runtime environment.
19. The computer-implemented method of claim 15, wherein the multi-version repository is a multi-version archive implemented in a platform-independent object-oriented programming language.
20. The computer-implemented method of claim 15, wherein the multi-version library is a dynamically linked library implemented using one or more of: C programming language, The C++ programming language, or Java programming language.
21. The computer-implemented method of claim 15, wherein the building further comprises compiling the base version of the class and at least one of the one or more other versions of the class as part of a single build function.
22. One or more non-transitory computer-readable storage media storing program instructions that, when executed on or across one or more processors, cause the one or more processors to perform the following operations: Building a runtime-linkable multi-version library comprising multiple versions of a class, wherein the multiple versions all correspond to the same class signature; The establishment includes: storing a base version of the multiple versions of the class in the multi-version library, wherein the base version of the class does not correspond to any version of a runtime environment; and One or more other versions of the multiple versions of the class are stored in the multi-version library, wherein each of the one or more other versions corresponds to a respective version of the runtime environment.
23. One or more non-transitory computer-readable storage media according to claim 22, wherein storing the one or more other versions of the class includes storing metadata in the multi-version library indicating that each of the other versions corresponds to a corresponding version of the runtime environment.
24. One or more non-transitory computer-readable storage media according to claim 22, wherein storing the base version of the class includes storing the base version of the class in a base folder of the multi-version library, wherein the folder is configured to store a corresponding base version of each class of one or more classes, and wherein the base folder does not correspond to any version of the runtime environment.
25. One or more non-transitory computer-readable storage media according to claim 22, wherein storing the one or more other versions of the class includes storing each of the one or more other versions in a corresponding folder in the multi-version library, wherein each corresponding folder is associated with a corresponding version of the runtime environment.
26. The one or more non-transitory computer-readable storage media of claim 22, wherein the building further comprises compiling the base version of the class and at least one of the one or more other versions of the class as part of a single build function.
27. The one or more non-transitory computer-readable storage media of claim 22, wherein the multi-version repository is a multi-version archive implemented in a platform-independent object-oriented programming language.
28. The one or more non-transitory computer-readable storage media of claim 22, wherein the multi-version library is a dynamically linked library implemented using one or more of: C programming language, The C++ programming language, or Java programming language.
29. A computing device comprising: processor; and A memory coupled to at least one processor, wherein the memory includes program instructions that, when executed by the at least one processor, cause the processor to perform: Building a runtime-linkable multi-version library comprising multiple versions of a class, wherein the multiple versions all correspond to the same class signature; wherein the building comprises: storing a base version of the multiple versions of the class in the multi-version library, wherein the base version of the class does not correspond to any version of the runtime environment; as well as One or more other versions of the multiple versions of the class are stored in the multi-version library, wherein each of the one or more other versions corresponds to a respective version of the runtime environment.
30. The computing device of claim 29, wherein the storing the one or more other versions of the class comprises storing metadata in the multi-version repository indicating that each of the other versions corresponds to a respective version of the runtime environment.
31. A computing device according to claim 29, wherein storing the base version of the class includes storing the base version of the class in a base folder of the multi-version library, wherein the folder is configured to store a corresponding base version of each class of one or more classes, and wherein the base folder does not correspond to any version of the runtime environment.
32. A computing device according to claim 29, wherein storing the one or more other versions of the class includes storing each of the one or more other versions in a corresponding folder in the multi-version library, wherein each corresponding folder is associated with a corresponding version of the runtime environment.
33. The computing device of claim 29, wherein the building further comprises compiling the base version of the class and at least one of the one or more other versions of the class as part of a single build function.
34. The computing device of claim 29, wherein the multi-version repository is a multi-version archive implemented in a platform-independent object-oriented programming language.
Citation Information
Patent Citations
System and method for building and updating a runtime environment
CN102422266A
Using dynamically-linked libraries to add side effects to operations
US5572709A
