Class Method Table Lookup for Fast Late Binding
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Managing multiple inheritances of properties in class-based objects is challenging due to interdependencies, leading to slow and memory-intensive lookup processes when using a simple accretive allocation strategy.
Innovation Solution
A method and apparatus that generate tables of methods and references for each class, where tables are copied forward with each inheritance declaration, allowing for efficient resolution of property references by retrieving the table associated with the current instance's class and resolving from the table of the corresponding object's class.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If a simple accretive allocation strategy is used for property lookup, then the implementation is simple, but the lookup speed is slow and memory usage is high
Solution Approach 1:
The patent pre-calculates and stores property offsets and sizes in lookup tables during class definition and inheritance setup. This preliminary action allows the runtime system to perform fast direct indexing operations instead of slow sequential searches through the inheritance hierarchy, resolving the contradiction between implementation simplicity and lookup speed.
Solution Approach 2:
The patent segments the property lookup process into distinct components: offset tables that store base offsets for each class, size tables that store property size information, and indexing structures that enable direct access. This segmentation transforms the slow monolithic search into multiple fast indexed operations.
2Ease of manufacture
If a simple accretive allocation strategy is used for property lookup, then the implementation is simple, but memory usage is high
Solution Approach 1:
The patent creates compact lookup tables that copy only the essential offset and size information needed for property access. Instead of storing complete property definitions or entire inheritance hierarchies in memory, the system copies minimal metadata into efficient lookup structures, reducing overall memory consumption while maintaining fast access.
Solution Approach 2:
The patent transforms the property representation from storing complete property objects to storing compact numeric parameters (offsets and sizes). This parameter change converts memory-intensive structured data into space-efficient numeric values that require minimal storage while enabling rapid computation.
3Reliability
If property lookup is performed by name in the inheritance hierarchy, then the correct property can be found, but the process is slow
Solution Approach 1:
The patent replaces the mechanical sequential search mechanism (traversing the inheritance hierarchy by property name) with a computational indexing mechanism. Lookup tables with pre-computed offsets enable direct mathematical calculation of property locations, substituting the slow iterative search with fast indexed access that maintains accuracy while dramatically reducing time.
Solution Approach 2:
The patent introduces lookup tables as intermediary structures between the property name and the actual property data. These tables act as mediators that translate property names into direct memory addresses through offset indexing, eliminating the need for slow hierarchical traversal while ensuring correct property resolution.
Data Source
AI summary
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 method with at least one class inheriting one or more method corresponding to one or more other classes. A table generator forms a table of methods and references associated with each class. The table is copied forward with each inheritance declaration. A reference to a method 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 method is referenced.


