Apparatus and method for checking dependencies among classes in an object-oriented program
First Claim
1. An apparatus comprising:
- at least one processor;
a memory coupled to the at least one processor;
an object-oriented program residing in the memory and executed by the at least one processor, the object-oriented program including a plurality of classes;
a version checker residing in the memory and executed by the at least one processor, the version checker checking at least one dependency between at least two of the plurality of classes;
wherein a definition for at least one of the plurality of classes includes static code that is executed once when the at least one class is loaded and that is not included in any instance of the at least one class, the static code including a call to the version checker.
1 Assignment
0 Petitions
Accused Products
Abstract
A dependency checking apparatus and method allows checking the version of classes in an object-oriented program to assure the proper version is being used for each release of the software. According to a first preferred embodiment, classes themselves include static code that checks dependencies when the class is loaded. The first embodiment is simple to implement for classes. According to a second preferred embodiment, information relating to version checking is stored separate from the classes and is used to check dependencies. This second embodiment is more flexible, allowing the checking of interfaces as well as classes, and allows the dependency information to be altered without recompiling the classes being checked.
114 Citations
35 Claims
-
1. An apparatus comprising:
-
at least one processor;
a memory coupled to the at least one processor;
an object-oriented program residing in the memory and executed by the at least one processor, the object-oriented program including a plurality of classes;
a version checker residing in the memory and executed by the at least one processor, the version checker checking at least one dependency between at least two of the plurality of classes;
wherein a definition for at least one of the plurality of classes includes static code that is executed once when the at least one class is loaded and that is not included in any instance of the at least one class, the static code including a call to the version checker. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
a name and a version of a dependor class;
a list of dependee classes to check for proper versions; and
a version list for each class in the list of dependee classes.
-
-
7. The apparatus of claim 5 wherein the dependency information determines if a version of a first of the plurality of classes is compatible with a version of a second of the plurality of classes.
-
8. The apparatus of claim 5 wherein the dependency information resides within at least one definition of at least one of the plurality of classes.
-
9. The apparatus of claim 5 wherein the dependency information resides external to the plurality of classes.
-
10. The apparatus of claim 9 wherein the dependency information resides in at least one file.
-
11. The apparatus of claim 9 wherein the dependency information resides on a computer system coupled to the world-wide web, and wherein the dependency information is accessed via a socket on the world-wide web.
-
12. The apparatus of claim 9 wherein the dependency information resides within a program that includes the version checker.
-
13. A method for checking at least one dependency among a plurality of classes in an object-oriented program, the object-oriented program including run-time code the method comprising the steps of:
-
(A) loading a first class that is one of the plurality of classes, the first class including static code that calls a version checker to check dependencies between the first class and a second class in the object oriented program;
(B) determining at least one dependency between the first class and at least one of the plurality of classes by executing the static code only when the first class is loaded;
(C) the execution of the static code automatically checking the at least one dependency determined in step (B) before executing the run-time code in the object-oriented program, wherein the run-time code does not execute the static code. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21)
a name and a version of a dependor class;
a list of dependee classes to check for proper versions; and
a version list for each class in the list of dependee classes.
-
-
20. The method of claim 18 wherein the step of reading dependency information that resides external to the plurality of classes comprises reading a file that contains the dependency information.
-
21. The method of claim 18 wherein the step of reading dependency information that resides external to the plurality of classes comprises reading from a socket on the woldwide web.
-
22. A program product comprising:
-
a version checker that checks at least one dependency between at least two of a plurality of classes in an object-oriented program that includes run-time code, wherein a definition for at least one of the plurality of classes includes static code that is executed only when the at least one class is loaded and before the run-time code is executed, and that is not executed by the run-time code, the static code including a call the version checker; and
signal bearing media bearing the version checker. - View Dependent Claims (23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35)
a name and a version of a dependor class;
a list of dependee classes to check for proper versions; and
a version list for each class in the list of dependee classes.
-
-
30. The program product of claim 28 wherein the dependency information determines if a version of a first of the plurality of classes is compatible with a version of a second of the plurality of classes.
-
31. The program product of claim 28 wherein the dependency information resides within at least one definition of at least one of the plurality of classes.
-
32. The program product of claim 28 wherein the dependency information resides external to the plurality of classes.
-
33. The program product of claim 32 wherein the dependency information resides in at least one file.
-
34. The program product of claim 32 wherein the dependency information resides on a computer system coupled to the world-wide web, and wherein the dependency information is accessed via a socket on the world-wide web.
-
35. The program product of claim 32 wherein the dependency information resides within a program that includes the version checker.
Specification