Abstract:
Disclosed are a method and system for binding a program object in a source code to one of a number of implementations of the program object, using caching techniques. Binding a program object to a particular implementation includes performing the binding process at compile time and runtime of the source code. During compilation phase, the program objects in the source code are identified, and each of the program objects is assigned a slot in a target cache. The slot is configured to store a pointer that points to a particular implementation of a program object to which the slot is assigned. During execution phase, the particular implementation of the program object is determined based on execution flow of the source code. After the particular implementation is determined, the program object is bound to the particular implementation by updating the assigned target cache slot with a pointer pointing to the particular implementation.