Apparatus and method for allowing object-oriented programs created with different framework versions to communicate
First Claim
1. Apparatus for allowing a first object-oriented program created with a first framework version to polymorphically stream object information to a second object-oriented program created with a second framework version, the apparatus comprising:
- a stream writer function in the first object-oriented program for generating a stream that contains both original object information recognized by the first object-oriented program followed by substitute object information recognized by the second object-oriented program in the same stream; and
a stream reader function in the second object-oriented program, responsive to streamed object information for examining the streamed object information to determine whether the original object information is recognized by the second object-oriented program and for reading the original object information from the stream when the original object information is recognized by the second object-oriented program and for skipping the original object information and reading the substitute object information from the stream when the original object information is not recognized by the second object-oriented program.
2 Assignments
0 Petitions
Accused Products
Abstract
A set of stream writer and reader classes and methods enable object frameworks to communicate with each other despite problems with missing classes due to mismatched versions. The stream writers are modified to deal with a new version of a class that extends from a class in an existing version by writing alternate object information compatible with the existing version when the future object class information is streamed. In this manner, alternate object information is written for each older version. The information for each of the alternate objects corresponding to each older version is added after the existing object information as an extension with the length of the extension written at the beginning. The stream readers are modified so that when an older version stream reader reads the object information and does not understand the first alternate object (which might correspond to a later version), it skips the length specified for that extension and reads the second alternate object. If the second alternate object information is not understood, the reader skips the non-understood object information and continues with each alternate object. If none of the alternates is understood, then an exception is thrown. In one embodiment, the information for alternate objects which are not used is not discarded, but is instead saved in a temporary storage. Then, if the object is streamed out again, the stored information is added back into the stream.
61 Citations
30 Claims
-
1. Apparatus for allowing a first object-oriented program created with a first framework version to polymorphically stream object information to a second object-oriented program created with a second framework version, the apparatus comprising:
-
a stream writer function in the first object-oriented program for generating a stream that contains both original object information recognized by the first object-oriented program followed by substitute object information recognized by the second object-oriented program in the same stream; and
a stream reader function in the second object-oriented program, responsive to streamed object information for examining the streamed object information to determine whether the original object information is recognized by the second object-oriented program and for reading the original object information from the stream when the original object information is recognized by the second object-oriented program and for skipping the original object information and reading the substitute object information from the stream when the original object information is not recognized by the second object-oriented program. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A method for allowing a first object-oriented program created with a first framework version to polymorphically stream object information to a second object-oriented program created with a second framework version, the method comprising the steps of:
-
(a) generating with the first object-oriented program a stream that contains both original object information recognized by the first object-oriented program followed by substitute object information recognized by the second object-oriented program in the same stream;
(b) examining streamed object information in the second object-oriented program to determine whether the original object information is recognized by the second object-oriented program;
(c) reading the original object information from the stream in the second object-oriented program when the original object information is recognized by the second object-oriented program; and
(d) skipping the original object information and reading the substitute object information from the stream when the original object information is not recognized by the second object-oriented program. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20)
(d1) discarding the original object information when the stream reader function does not recognize the original object information.
-
-
13. A method according to claim 11 wherein step (d) comprises the step of:
(d2) saving the original object information when the stream reader function does not recognize the original object information.
-
14. A method according to claim 13 further comprising the step of:
(e) streaming the saved original object information back to the first object-oriented program.
-
15. A method according to claim 11 wherein the original object information comprises base object information and extension information and wherein step (a) comprises the step of:
(a1) streaming the extension information followed by the base object information.
-
16. A method according to claim 15 wherein step (d) comprises the step of:
(d3) skipping the extension information and reading the base object information when the stream reader function does not recognize the extension information.
-
17. A method according to claim 11 wherein step (a) comprises the step of:
(a2) streaming as the substitute object information, information for an alternate object which is recognized by the second object-oriented program.
-
18. A method according to claim 17 wherein step (a) comprises the step of:
(a3) streaming both the original object information and the alternate object information.
-
19. A method according to claim 17 wherein step (c) comprises the step of:
-
(c1) reconstructing the original object information when the stream reader recognizes the original object information; and
step (d) comprises the step of; (d4) reconstructing the alternate object information when the stream reader does not recognize the original object information.
-
-
20. A method according to claim 11 wherein step (a) comprises the step of:
(a4) constructing a context object which maintains references to the object information.
-
21. A computer program product for allowing a first object-oriented program created with a first framework version to polymorphically stream object information to a second object-oriented program created with a second framework version, the computer program product comprising a computer usable medium having computer readable program code thereon, including:
-
program code in the first object-oriented program for generating a stream that contains both original object information recognized by the first object-oriented program followed by substitute object information recognized by the second object-oriented program in the same stream;
program code in the second object-oriented program for examining streamed object information to determine whether the original object information is recognized by the second object-oriented program;
program code in the second object-oriented program for reading the original object information from the stream when the original object information is recognized by the second object-oriented program; and
program code for skipping the original object information and reading the substitute object information from the stream when the original object information is not recognized by the second object-oriented program. - View Dependent Claims (22, 23, 24, 25, 26, 27, 28, 29, 30)
-
Specification