Redundancy elimination in the persistence of object graphs
First Claim
1. A method for serializing an object graph into a persistent form, wherein the object graph comprises one or more objects, wherein each object has one or more properties, wherein each property has an associated value, the method comprising:
- serializing the object graph to a temporary serialized form, wherein the temporary serialized form comprises instantiation statements and assignment statements;
deserializing the instantiation statements of the temporary serialized form to create a copy of the object graph, wherein properties in the copy of the object graph are assigned default values;
examining each statement in the temporary serialized form to determine whether each statement is redundant;
writing to a final serialized form each statement that is not redundant.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and system for incrementally serializing an object graph to a persistent form. An object graph is a set of nested objects, each with one or more properties. An object graph in a first environment is serialized to a temporary serialized form. At substantially the same time, the temporary serialized form is read into a second environment and deserialized in the second environment. By deserializing instantiation statements taken from the temporary form, a copy of the object graph is created in the second environment, wherein the objects have default values. For each object, only statements in the temporary serialized form that would alter the second environment are maintained in a final serialized form. The properties of classes are accessed through public APIs to avoid reliance on private implementations of classes. Therefore, serialized forms will typically still be deserializable even when private implementations are different across different platforms or across the same platform over time. Incremental serialization also includes error recovery and mechanisms to handle several special cases.
-
Citations
28 Claims
-
1. A method for serializing an object graph into a persistent form, wherein the object graph comprises one or more objects, wherein each object has one or more properties, wherein each property has an associated value, the method comprising:
-
serializing the object graph to a temporary serialized form, wherein the temporary serialized form comprises instantiation statements and assignment statements;
deserializing the instantiation statements of the temporary serialized form to create a copy of the object graph, wherein properties in the copy of the object graph are assigned default values;
examining each statement in the temporary serialized form to determine whether each statement is redundant;
writing to a final serialized form each statement that is not redundant. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
wherein the objects are reusable components. -
3. The method of claim 2,
wherein the reusable components are JavaBeans. -
4. The method of claim 1,
wherein examining each statement in the temporary serialized form to determine whether each statement is redundant further comprises examining each assignment statement in the temporary serialized form to determine whether each assignment statement would alter the copy of the object graph; wherein writing to the final serialized form each statement that is not redundant further comprises writing to the final serialized form each assignment statement that would alter the copy of the object graph.
-
5. The method of claim 4,
wherein examining each assignment statement in the temporary serialized form to determine whether each assignment statement would alter the copy of the object graph further comprises comparing a left-hand side to a right-hand side of each assignment statement. -
6. The method of claim 1,
wherein examining each statement in the temporary serialized form to determine whether each statement is redundant further comprises examining each instantiation statement in the temporary serialized form to determine whether each instantiation statement would generate an instance of a different class; wherein writing to the final serialized form each statement that is not redundant further comprises writing to the final serialized form each instantiation statement that would generate an instance of a different class.
-
7. The method of claim 1,
wherein deserializing the instantiation statements of the temporary serialized form further comprises invoking a constructor for a class associated with each of the objects in the temporary serialized form; wherein invoking the constructor further comprises instantiating a new object of the class and assigning default values to the properties of the new object.
-
8. The method of claim 1, further comprising:
deserializing the statements of the final serialized form upon the copy of the object graph.
-
9. The method of claim 1,
wherein one or more of the values of the properties is an object.
-
-
10. A carrier medium comprising program instructions for serializing an object graph into a persistent form, wherein the object graph comprises one or more objects, wherein each object has one or more properties, wherein each property has an associated value, wherein the program instructions are executable to implement:
-
serializing the object graph to a temporary serialized form, wherein the temporary serialized form comprises instantiation statements and assignment statements;
deserializing the instantiation statements of the temporary serialized form to create a copy of the object graph, wherein properties in the copy of the object graph are assigned default values;
examining each statement in the temporary serialized form to determine whether each statement is redundant; and
writing to a final serialized form each statement that is not redundant. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18, 19)
wherein examining each statement in the temporary serialized form to determine whether each statement is redundant further comprises examining each assignment statement in the temporary serialized form to determine whether each assignment statement would alter the copy of the object graph; wherein writing to the final serialized form each statement that is not redundant further comprises writing to the final serialized form each assignment statement that would alter the copy of the object graph.
-
-
12. The carrier medium of claim 11,
wherein examining each assignment statement in the temporary serialized form to determine whether each assignment statement would alter the copy of the object graph further comprises comparing a left-hand side to a right-hand side of each assignment statement. -
13. The carrier medium of claim 10,
wherein examining each statement in the temporary serialized form to determine whether each statement is redundant further comprises examining each instantiation statement in the temporary serialized form to determine whether each instantiation statement would generate an instance of a different class; wherein writing to the final serialized form each statement that is not redundant further comprises writing to the final serialized form each instantiation statement that would generate an instance of a different class.
-
14. The carrier medium of claim 10,
wherein deserializing the instantiation statements of the temporary serialized form further comprises invoking a constructor for a class associated with each of the objects in the temporary serialized form; wherein invoking the constructor further comprises instantiating a new object of the class and assigning default values to the properties of the new object.
-
15. The carrier medium of claim 10, wherein the program instructions are further executable to implement:
deserializing the statements of the final serialized form upon the copy of the object graph.
-
16. The carrier medium of claim 10,
wherein one or more of the values of the properties is an object. -
17. The carrier medium of claim 10,
wherein the objects are reusable components. -
18. The carrier medium of claim 17,
wherein the reusable components are JavaBeans. -
19. The carrier medium of claim 10,
wherein the carrier medium is a storage medium.
-
20. A computer system for serializing an object graph into a persistent form, wherein the object graph comprises one or more objects, wherein each object has one or more properties, wherein each property has an associated value, the computer system comprising:
-
a CPU;
a system memory coupled to the CPU;
a persistent memory coupled to the CPU;
wherein the system memory stores program instructions executable by the CPU, wherein the program instructions are executable to;
serialize the object graph to a temporary serialized form, wherein the temporary serialized form comprises instantiation statements and assignment statements;
deserialize the instantiation statements of the temporary serialized form to create a copy of the object graph, wherein properties in the copy of the object graph are assigned default values;
examine each statement in the temporary serialized form to determine whether each statement is redundant;
write to a final serialized form each statement that is not redundant. - View Dependent Claims (21, 22, 23, 24, 25, 26, 27, 28)
wherein in examining each statement in the temporary serialized form to determine whether each statement is redundant, the program instructions are further executable to examine each assignment statement in the temporary serialized form to determine whether each assignment statement would alter the copy of the object graph; wherein in writing to the final serialized form each statement that is not redundant, the program instructions are further executable to write to the final serialized form each assignment statement that would alter the copy of the object graph.
-
-
22. The computer system of claim 21,
wherein in examining each assignment statement in the temporary serialized form to determine whether each assignment statement would alter the copy of the object graph, the program instructions are further executable to compare a left-hand side to a right-hand side of each assignment statement. -
23. The computer system of claim 20,
wherein in examining each statement in the temporary serialized form to determine whether each statement is redundant, the program instructions are further executable to examine each instantiation statement in the temporary serialized form to determine whether each instantiation statement would generate an instance of a different class; wherein in writing to the final serialized form each statement that is not redundant, the program instructions are further executable to write to the final serialized form each instantiation statement that would generate an instance of a different class.
-
24. The computer system of claim 20,
wherein in deserializing the instantiation statements of the temporary serialized form, the program instructions are further executable to invoke a constructor for a class associated with each of the objects in the temporary serialized form; wherein in invoking the constructor, the program instructions are further executable to instantiate a new object of the class and assign default values to the properties of the new object.
-
25. The computer system of claim 20, wherein the program instructions are further executable to:
deserialize the statements of the final serialized form upon the copy of the object graph.
-
26. The computer system of claim 20,
wherein one or more of the values of the properties is an object. -
27. The computer system of claim 20,
wherein the objects are reusable components. -
28. The computer system of claim 27,
wherein the reusable components are JavaBeans.
Specification