Fast late binding of object properties
AssigneeRed Hat, Inc.
InventorJames Paul Schneider
Life of this patent
Estimating the term…
Abstract
An apparatus and a method for managing class properties in a computer program is described. Classes are declared. Each class is associated with a corresponding property with at least one class inheriting one or more property corresponding to one or more other classes. A table generator forms a table of property offsets associated with each class. The table is copied forward with each inheritance declaration. A reference to a property of a class is resolved by retrieving the table associated with a current instance's class and resolving from the table associated with the class corresponding to an object from which the property is referenced.
Claims21
A computer-implemented method comprising:
- declaring a plurality of classes for a computer program to be executed on a computer system, each class associated with a plurality of corresponding properties, at least one class inheriting one or more properties corresponding to one or more other classes;
- forming, by a table generator of the computer system, a table of property offsets associated with each class, the table copied forward with each inheritance declaration;
- and
- resolving, by a reference resolver of the computer system, a reference to a property of a class by retrieving the table associated with a current instance's class and resolving from the table associated with the class corresponding to an object from which the property is referenced.
A computer-readable storage medium, having instructions stored therein, which when executed, cause a computer system to perform a method comprising:
- declaring a plurality of classes, each class associated with a plurality of corresponding properties, at least one class inheriting one or more properties corresponding to one or more other classes;
- forming a table of property offsets associated with each class, the table copied forward with each inheritance declaration;
- and
- resolving a reference to a property of a class by retrieving the table associated with a current instance's class and resolving from the table associated with the class corresponding to an object from which the property is referenced.
A computer system comprising:
- a table generator configured to declare a plurality of classes, each class associated with a plurality of corresponding properties, at least one class inheriting one or more properties corresponding to one or more other classes, and to form a table of property offsets associated with each class, the table copied forward with each inheritance declaration;
- and
- a reference resolver coupled to the table generator, the reference resolver configured to resolve a reference to a property of a class by retrieving the table associated with a current instance's class and resolving from the table associated with the class corresponding to an object from which the property is referenced.
Dependencies are inferred from the claim text.