Partial methods
AssigneeMicrosoft Corporation
InventorsDinesh C. Kulkarni, Mads Torgersen, Henricus Johannes Maria Meijer, Anders Hejlsberg, Matthew J. Warren, Peter A. Hallam
Life of this patent
Estimating the term…
Abstract
Partial methods enable separation of method declaration and/or calls from method implementation. A partial method specifies a signature of a join or hook point in a class. Calls to a partial method specify a join or hook point in code that can optionally be linked with an actual method implementation of the same signature. Separate method implementations or other code related to a partial method are injected into a single program prior to execution. Unimplemented partial methods are treated as no operation instructions or otherwise ignored.
Claims22
A computer system, the computer system comprising a processor operatively coupled to a memory and one or more storage media having computer-executable instructions that, when executed by the processor, implement a method for integrating partial method implementations into a source code program that includes partial method calls, the method comprising:
- a processor acquiring a source code program that includes one or more partial method calls, wherein at least one of the partial method calls is associated with a partial method hook signature that is used to identify one or more partial method implementations outside of the at least one partial method call and that can be applied at the at least one partial method call to implement the at least one partial method call;
- the processor acquiring a particular partial method implementation that implements code for the least one partial method call and which is acquired upon identifying that the particular partial method implementation has a particular partial method hook signature matching the partial method hook signature of the least one partial method call;
- the processor injecting the particular partial method implementation into the source code by injecting implementation code from the particular partial method implementation directly into the source code;
- and
- the processor transforming the source code into target code by at least compiling the source code with the injected implementation code, while treating any unimplemented partial method calls as no operation instructions.
A method implemented within a computer system that includes a processor and memory storing instructions which, when executed by the processor, implement the method for integrating partial method implementations into a source code program that includes partial method calls, the method comprising:
- acquiring a source code program that includes one or more partial method calls, wherein at least one of the partial method calls is associated with a partial method hook signature that is used to identify one or more partial method implementations outside of the at least one partial method call and that can be applied at the at least one partial method call to implement the at least one partial method call;
- acquiring a particular partial method implementation that implements code for the least one partial method call and which is acquired upon identifying that the particular partial method implementation has a particular partial method hook signature matching the partial method hook signature of the least one partial method call;
- injecting the particular partial method implementation into the source code by injecting implementation code from the particular partial method implementation directly into the source code;
- and
- transforming the source code into target code by at least compiling the source code with the injected implementation code, while treating any unimplemented partial method calls as no operation instructions.
One or more storage media having stored thereon computer-executable instructions that, when executed by one or more processors of a computer system, implement a method for integrating partial method implementations into a source code program that includes partial method calls, the method comprising:
- a computing system, having one or more processors, acquiring a source code program that includes one or more partial method calls, wherein at least one of the partial method calls is associated with a partial method hook signature that is used to identify one or more partial method implementations outside of the at least one partial method call and that can be applied at the at least one partial method call to implement the at least one partial method call;
- the computing system acquiring a particular partial method implementation that implements code for the least one partial method call and which is acquired upon identifying that the particular partial method implementation has a particular partial method hook signature matching the partial method hook signature of the least one partial method call;
- the computing system injecting the particular partial method implementation into the source code by injecting implementation code from the particular partial method implementation directly into the source code;
- and
- the computing system transforming the source code into target code by at least compiling the source code with the injected implementation code, while treating any unimplemented partial method calls as no operation instructions.
Dependencies are inferred from the claim text.