Attribute based method redirection
AssigneeMicrosoft Corporation
InventorsRaja Kirshnaswamy, Yi Zhang, Scott D. Mosier, Ladislav Prosek, Xiaoying Guo
Life of this patent
Estimating the term…
Abstract
A programming environment may have an abstract interface definition that may contain a redirection definition that may cause a call to be bound to a redirected method or function. The redirected method or function may be a conditional redirection, and some embodiments may perform various checks including signature checks, static and runtime access checks, and other verifications for the redirected method. The redirection may enable a programmer to modify a portion of an interface without having to re-implement all of the functions of the interface.
Claims19
A method being performed on a computer processor, said method comprising:
- creating a first interface as an abstract type, said first interface defining a first abstract method, said first interface implementable by objects having a plurality of different types of classes;
- creating a concrete type that implements said first interface, said concrete type comprising an implementation of said first abstract method as a first concrete method;
- compiling said concrete type to generate executable code, and generating a mapping for said first abstract method to said first concrete method during said compiling;
- modifying said first interface to create a second interface, said second interface comprising a redirection for said first abstract method, said redirection comprising a second concrete method;
- linking said second interface with said executable code;
- determining a first signature for said first concrete method;
- determining a second signature for said second concrete method;
- executing said executable code in a first process;
- during said executing, receiving a call to said second interface for said first abstract method, analyzing said redirection, and causing said second concrete method to be performed instead of said first concrete method;
- and
- permitting said second concrete method to be executed when said first signature and said second signature match.
A system comprising:
- at least one processor and a memory;
- a linker configured to perform a first process comprising:
- receiving a first code comprising a mapping between a first set of methods defined in a first version of an interface, said interface being an abstract type, said interface implementable by objects having a plurality of different types of classes, said first version implemented by a first object having a first object type class, and a second set of methods defined in said first code, said second set of methods being concrete methods, a first abstract method being mapped to a first concrete method in said mapping;
- receiving a second version of said interface, said second version comprising a redirection for a first abstract method defined in said first version of said interface, said first abstract method being one of said first set of methods, said redirection comprising a second concrete method, said second version of said interface implemented by an object having a different object type of class than said first object;
- identifying a call to said first abstract method from a second code;
- and
- linking said second concrete method in place of said first concrete method based on said redirection;
- determining a first signature for said first concrete method;
- determining a second signature for said second concrete method;
- a runtime execution system configured to perform a second process comprising:
- executing said second code;
- executing said call to said first abstract method within said second code;
- evaluating said redirection;
- and
- executing said second concrete method in place of said first concrete method as defined in said redirection when said first signature matches said second signature;
- a processor on which said runtime execution system executes.
A runtime environment stored in a computer readable memory being executable on a processor, said runtime environment comprising:
- a runtime compiler configured to receive intermediate code and compile said intermediate code to generate executable code;
- a runtime linker configured to:
- receive a first code comprising a mapping between a first set of methods defined in a first version of an interface, said interface being an abstract type, said interface implementable by objects having a plurality of different types of classes, said first version implemented by a first object having a first object type class, and a second set of methods defined in said first code, said mapping comprising a first abstract method being mapped to a first concrete method;
- receive a second version of said interface, said second version comprising a redirection for said first abstract method defined in said first version of said interface, said first abstract method being one of said first set of methods, said redirection comprising a second concrete method, said second version of said interface implemented by an object having a different object type of class than said first object;
- identifying a call to said first abstract method from a second code;
- and
- linking said second concrete method in place of said first concrete method based on said redirection;
- determining a first signature for said first concrete method;
- determining a second signature for said second concrete method;
- a runtime execution system configured to:
- executing said second code;
- executing said call to said first abstract method within said second code;
- evaluating said redirection;
- and
- executing said second concrete method in place of said first concrete method as defined in said redirection when said first signature matches said second signature.
Dependencies are inferred from the claim text.