Method and apparatus for determining compatibility of parent classes in an object oriented environment using versioning
First Claim
1. A method in a computer for versioning a class with a parent class in an object oriented environment, the process comprising the computer implemented steps of:
- identifying a version of the parent class of the class;
identifying a required version for the parent class;
comparing the version to the required version;
responsive to a lack of correspondence between the version and the required version, identifying versions compatible with the version of the parent class, wherein the versions are identified versions; and
determining whether the identified versions correspond to the required version.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus in a computer for comparing version information contained within class definitions to determine compatibility between classes in a hierarchy within an object oriented system.
Version information is collected from the class being instantiated and its parent class. This information includes current version, compatible versions, and the version requirements of the class of its parent class. The required version is used to determine compatibility with the parent class. The runtime system utilizes this collection of information from both class definitions, analyzes the version relationship and determines the course of action to take based on this analysis.
160 Citations
40 Claims
-
1. A method in a computer for versioning a class with a parent class in an object oriented environment, the process comprising the computer implemented steps of:
-
identifying a version of the parent class of the class;
identifying a required version for the parent class;
comparing the version to the required version;
responsive to a lack of correspondence between the version and the required version, identifying versions compatible with the version of the parent class, wherein the versions are identified versions; and
determining whether the identified versions correspond to the required version. - View Dependent Claims (2, 3)
-
-
4. A method in a computer for determining compatibility between a child class and a parent class for the child class, the process comprising the computer implemented steps of:
-
receiving a request to load a child class;
obtaining a child version identifier for the child class;
obtaining a parent version identifier for the parent class;
determining whether the parent version identifier matches the child version identifier;
responsive to a determination that a match between the parent version identifier and the child version identifier is absent, obtaining a plurality of version identifiers compatible with the parent version identifier; and
responsive to obtaining the plurality of version identifiers, determining whether a match between the child version identifier and one of the plurality of version identifiers is present. - View Dependent Claims (5, 6, 7, 8, 9, 10)
responsive to an absence of a match between the child version indent flyer and one of the plurality of version identifiers, generating an exception.
-
-
6. The method of claim 4, further comprising:
responsive to an absence of a match between the child version identifier and one of the plurality of version identifiers, preventing instantiation of the child class.
-
7. The method of claim 4, further comprising:
responsive to an absence of a match between the child version identifier and one of the plurality of version identifiers, completing instantiation of the child class.
-
8. The method of claim 4, wherein the child version identifier is an interface version number.
-
9. The method of claim 4, wherein the child version identifier is an implementation version number.
-
10. The method of claim 4, wherein the class is a Java class.
-
11. A method in a data processing system for identifying compatibility between a first object and a second object in an object-oriented environment, the method comprising the data processing system implemented steps of:
-
obtaining a first version number of the first object and compatible version numbers identifying versions compatible with the version number;
identifying a second version number identifying a version required for compatibility with the second object;
comparing the first version number with the second version number; and
responsive to an absence of a match between the first version number and the second version number, determining whether a match is present between the second version number and one of the compatible version numbers. - View Dependent Claims (12, 13)
-
-
14. A method in a computer for identifying compatibility between a child class and a parent class, wherein the child class and the parent class each have an interface and an implementation and wherein the child class has a version requirement for compatibility with the parent class, the method comprising the computer implemented steps of:
-
obtaining, from the parent class, an interface version identification and an implementation identification for the parent class;
comparing the version requirement of the child class with an interface version identification and an implementation identification for the parent class;
responsive to an absence of a match between the version requirement of the child class with the an interface version identification and the implementation identification for the parent class, obtaining, from the parent class, an identification of interface versions and implementation versions compatible with the interface version identification and an implementation identification for the parent class; and
determining whether the version requirement matches the interface versions and implementation versions compatible with the an interface version identification and an implementation identification for the parent class.
-
-
15. A class data structure for use in an object oriented environment comprising:
-
a plurality of class declarations, each comprising;
a first field which identifies a required parent class version;
a second field which identifies a current version for the class; and
a third field which identifies versions to which the current version is backward compatible;
wherein, a positive comparison between said second field of a child class and either of said first field of a parent class or said third field of said parent class indicates that said child class and said parent class can be used together with compatibility.
-
-
16. A data processing system in a computer for versioning a class with a parent class in an object oriented environment, the data processing system comprising:
-
first identifying means for identifying a version of the parent class of the class;
second identifying means for identifying a required version for the parent class;
comparing means for comparing the version to the required version;
third identifying means, responsive to a lack of correspondence between the version and the required version, for identifying versions compatible with the version of the parent class, wherein the versions are identified versions; and
determining means for determining whether the identified versions correspond to the required version. - View Dependent Claims (17, 18)
-
-
19. A data processing system in a computer for determining compatibility between a child class and a parent class for the child class, the data processing system comprising:
-
receiving means for receiving a request to load a child class;
first obtaining means for obtaining a child version identifier for the child class;
second obtaining means for obtaining a parent version identifier for the parent class;
first determining means for determining whether the parent version identifier matches the child version identifier;
third obtaining means, responsive to a determination that a match between the parent version identifier and the child version identifier is absent, for obtaining a plurality of version identifiers compatible with the parent version identifier; and
second determining means, responsive to obtaining the plurality of version identifiers, for determining whether a match between the child version identifier and one of the plurality of version identifiers is present. - View Dependent Claims (20, 21, 22, 23, 24, 25)
generating means, responsive to an absence of a match between the child version identifier and one of the plurality of version identifiers, for generating an exception.
-
-
21. The data processing system of claim 19, further comprising:
preventing means, responsive to an absence of a match between the child version identifier and one of the plurality of version identifiers, for preventing instantiation of the child class.
-
22. The data processing system of claim 19, further comprising:
completing means, responsive to an absence of a match between the child version identifier and one of the plurality of version identifiers, for completing instantiation of the child class.
-
23. The data processing system of claim 19, wherein the child version identifier is an interface version number.
-
24. The data processing system of claim 19, wherein the child version identifier is an implementation version number.
-
25. The data processing system of claim 19, wherein the class is a Java class.
-
26. A data processing system for identifying compatibility between a first object and a second object in an object-oriented environment, the data processing system comprising:
-
obtaining means for obtaining a first version number of the first object and compatible versions numbers identifying versions compatible with the version number;
identifying means for identifying a second version number identifying a version required for compatibility with the second object;
comparing means for comparing the first version number with the second version number; and
determining means, responsive to an absence of a match between the first version number and the second version number, for determining whether a match is present between the second version number of one of the compatible version numbers. - View Dependent Claims (27, 28)
-
-
29. A data processing system in computer for identifying compatibility between a child class and a parent class, wherein the child class and the parent class each have an interface and an implementation and wherein the child class has a version requirement for compatibility with the parent class, the data processing system comprising:
-
first obtaining means for obtaining, from the parent class, an interface version identification and an implementation identification for the parent class;
comparing means for comparing the version requirement of the child class with the an interface version identification and an implementation identification for the parent class;
second obtaining means, responsive to an absence of a match between the version requirement of the child class with the an interface version identification and an implementation identification for the parent class, for obtaining, from the parent class, an identification of interface versions and implementation versions compatible with the an interface version identification and an implementation identification for the parent class; and
determining means for determining whether the version requirement matches the interface versions and implementation versions compatible with the an interface version identification and an implementation identification for the parent class.
-
-
30. A computer program product in a computer readable medium for versioning a class with a parent class in an object oriented environment, the computer program product comprising:
-
first instructions for identifying a version of the parent class of the class;
second instructions for identifying a required version for the parent class;
third instructions for comparing the version to the required version;
fourth instructions, responsive to a lack of correspondence between the version and the required version, for identifying versions compatible with the version of the parent class, wherein the versions are identified versions; and
fifth instructions for determining whether the identified versions correspond to the required version.
-
-
31. A computer program product in a computer readable medium for determining compatibility between a child class and a parent class for the child class, the computer program product comprising:
-
first instructions for receiving a request to load a child class;
second instructions for obtaining a child version identifier for the child class;
third instructions for obtaining a parent version identifier for the parent class;
fourth instructions for determining whether the parent version identifier matches the child version identifier;
fifth instructions, responsive to a determination that a match between the parent version identifier and the child version Identifier is absent, for obtaining a plurality of version identifiers compatible with the parent version identifier; and
sixth instructions, responsive to obtaining the plurality of version identifiers, for determining whether a match between the child version identifier and one of the plurality of version identifiers is present.
-
-
32. A computer program product in a computer readable medium for identifying compatibility between a first object and a second object in an object-oriented environment, the computer program product comprising:
-
first instructions for obtaining a first version number of the first object and compatible versions numbers identifying versions compatible with the version number;
second instructions for identifying a second version number identifying a version required for compatibility with the second object;
third instructions for comparing the first version number with the second version number; and
fourth instructions, responsive to an absence of a match between the first version number and the second version number, for determining whether a match is present between the second version number and one of the compatible version numbers.
-
-
33. A computer program product in a computer readable medium for identifying compatibility between a child class and a parent class, wherein the child class and the parent class each have an interface and an implementation and wherein the child class has a version requirement for compatibility with the parent class, the computer program product comprising:
-
first instructions for obtaining, from the parent class, an interface version identification and an implementation identification for the parent class;
second instructions for comparing the version requirement of the child class with the an interface version identification and an implementation identification for the parent class;
third instructions, responsive to an absence of a match between the version requirement of the child class with the an Interface version identification and an implementation identification for the parent class, for obtaining, from the parent class, an identification of interface versions and implementation versions compatible with the an interface version identification and an implementation identification for the parent class; and
fourth instructions for determining whether the version requirement matches the interface versions and implementation versions compatible with the an interface version identification and an implementation identification for the parent class.
-
-
34. A method in a computer for determining compatibility between a class and its parent class in an object oriented environment, the method comprising the steps of:
-
storing, in a declaration for each class, a first field which identifies a version of the class, a second field which identifies a version of the parent class which is necessary for compatibility with said class, and a third field which contains a list of versions with which the version of the parent class is backward compatible, and when a compatibility check between a child class and a respective parent class is requested, returning a value corresponding to compatible if said second field of said child declaration is the same as either said first field of said parent declaration or one of said list of versions of said third field of said parent declaration, otherwise returning a value corresponding to not compatible. - View Dependent Claims (35, 36)
-
-
37. A data processing system in a computer for determining compatibility between a child class and a parent class in an object oriented environment, the data processing system comprising:
-
receiving means for receiving a request to load the child class;
first obtaining means for obtaining, from a declaration of said child class, a child version-identifier which identifies a parent version necessary for compatibility;
second obtaining means for obtaining, from a declaration of said parent class, a parent version-identifier which identifies a current version of said parent class;
first determining means for determining whether said parent version-identifier matches said child version-identifier;
third obtaining means for obtaining, from said declaration of said parent class, a compatible version-identifier which identifies a plurality of parent versions with which said current version of said parent class are backward compatible; and
second determining means, responsive to obtaining said compatible version-identifier, for determining whether said child version-identifier matches one of said plurality of parent versions in said compatible version-identifier;
wherein, a compatible match is acknowledged when either said first determining means or said second determining means returns a match. - View Dependent Claims (38, 39, 40)
-
Specification