Declarative object identity using relation types
AssigneeInternational Business Machines Corporation
InventorsMandana Vaziri-Farahani, Frank Tip, Stephen J. Fink, Julian T. Dolby
Life of this patent
Estimating the term…
Abstract
The present invention provides a programming model based on a relational view of the heap which defines identity declaratively, obviating the need for equals( ) and hashcode( ) methods. Each element in the heap (called a tuple) belongs to a relation type and relates an immutable identity to mutable state. The model entails a stricter contract: identity never changes during an execution. Objects, values, and singletons arise as special cases of tuples.
Claims20
A computer-based method for determining an identity for objects generated by an application, the method comprising:
- receiving a class C with a set of fields F, with a portion of the fields F designated as immutable;
- designating at least one subset of the set of immutable fields F as a set of key fields contributing to an identify of objects;
- and
- enforcing a relation that defines equality between the objects of the class C based on a combination of objects being a same type and the set of key fields which have been designated, even as values in mutable portions of the objects themselves change.
A non-transitory computer readable medium containing programming instructions for determining an identity for objects generated by an application, the programming instructions comprising:
- receiving a class C with a set of fields F, with a portion of the fields F designated as immutable;
- designating at least one subset of the set of immutable fields F as a set of key fields contributing to an identify of objects;
- and
- enforcing a relation that defines equality between the objects of the class C based on a combination of objects being a same type and the set of key fields which have been designated, even as values in mutable portions of the objects themselves change.
A computer system for determining an identity for objects generated by an application, the computer system comprising:
- a storage medium readable by a processing circuit and storing computer instructions for execution by the processing circuit for performing a method comprising:
- receiving a class C with a set of fields F, with a portion of the fields F designated as immutable;
- designating at least one subset of the set of immutable fields F as a set of key fields contributing to an identify of objects;
- and
- enforcing a relation that defines equality between the objects of the class C based on a combination of objects being a same type and the set of key fields which have been designated, even as values in mutable portions of the objects themselves change.
Dependencies are inferred from the claim text.