Method selection in an external language based on output parameters
First Claim
Patent Images
1. A computer-implemented method comprising:
- receiving a signature of a first language system method call,the first language system method call originating in a first language system, andthe receiving performed by a computing device;
analyzing the signature of the first language system method call, the analyzing performed by the computing device;
determining;
zero or more input parameters of the first language system method call, andone or more output parameters of the first language system method call, where;
the determining is based on the analyzing,the determining is performed by the computing device, andan output signature of the first language system method call, wherein the output signature of the first language system method call comprises an indication of a number of the one or more output parameters of the first language system method call; and
interacting with a second language system,the second language system including a plurality of method implementations,the second language system including a second language,the second language system being distinct with respect to the first language system, andthe interacting performed by the computing device;
determining an output signature of a second language system method, wherein the output signature of the second language system method comprises an indication of a number of output parameters of the second language system method;
calculating fitness values for multiple ones of the plurality of method implementations, each fitness value indicating a fitness of a respective one of the plurality of method implementations relative to the first language system method call;
selecting a second language system method implementation from the plurality of method implementations,the selecting based on the interacting, andthe selecting performed by the computing device, wherein the selecting is performed based on the calculated fitness values; and
wherein the selecting of the second language system method implementation comprises;
identifying a parameter type for each output parameter of the output signature of the first language system method call; and
for each identified parameter type, determining a type capable of accepting the identified parameter type in the output signature of the second language system method by determining a casting type into which the identified parameter type may be cast without a loss of information;
mapping the first language system method call to the selected second language system method, wherein the mapping comprises casting the identified parameter type into the determined casting type, the mapping used when calling the second language system method in response to the first language system method call.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus, including a computer program apparatus, which facilitate invoking methods defined within a second language system from a first language system. When a method is invoked from the first language system, the techniques automatically compare the output parameters of the first language system method with the number and data-types of parameters output by methods defined within the second language system. Based on this comparison, the invention selects a method that best matches the output signature of the invoked method. The invention, therefore, allows a user to easily invoke methods from external objects, such as C# objects, directly from the first language system.
-
Citations
23 Claims
-
1. A computer-implemented method comprising:
-
receiving a signature of a first language system method call, the first language system method call originating in a first language system, and the receiving performed by a computing device; analyzing the signature of the first language system method call, the analyzing performed by the computing device; determining; zero or more input parameters of the first language system method call, and one or more output parameters of the first language system method call, where; the determining is based on the analyzing, the determining is performed by the computing device, and an output signature of the first language system method call, wherein the output signature of the first language system method call comprises an indication of a number of the one or more output parameters of the first language system method call; and interacting with a second language system, the second language system including a plurality of method implementations, the second language system including a second language, the second language system being distinct with respect to the first language system, and the interacting performed by the computing device; determining an output signature of a second language system method, wherein the output signature of the second language system method comprises an indication of a number of output parameters of the second language system method; calculating fitness values for multiple ones of the plurality of method implementations, each fitness value indicating a fitness of a respective one of the plurality of method implementations relative to the first language system method call; selecting a second language system method implementation from the plurality of method implementations, the selecting based on the interacting, and the selecting performed by the computing device, wherein the selecting is performed based on the calculated fitness values; and wherein the selecting of the second language system method implementation comprises; identifying a parameter type for each output parameter of the output signature of the first language system method call; and for each identified parameter type, determining a type capable of accepting the identified parameter type in the output signature of the second language system method by determining a casting type into which the identified parameter type may be cast without a loss of information; mapping the first language system method call to the selected second language system method, wherein the mapping comprises casting the identified parameter type into the determined casting type, the mapping used when calling the second language system method in response to the first language system method call. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
-
-
20. A computer-implemented method comprising:
-
receiving a signature of a first language system method call, the first language system method call originating in a first language system, and the receiving performed by a computing device; analyzing the signature of the first language system method call, the analyzing performed by the computing device; determining; zero or more input parameters of the first language system method call, and one or more output parameters of the first language system method call, where; the determining is based on the analyzing, the determining is performed by the computing device, and an output signature of the first language system method call, wherein the output signature of the first language system method call comprises an indication of a number of the one or more output parameters of the first language system method call; and interacting with a second language system, the second language system including a plurality of method implementations, the second language system including a second language, the second language system being distinct with respect to the first language system, and the interacting performed by the computing device; determining an output signature of a second language system method, wherein the output signature of the second language system method comprises an indication of a number of output parameters of the second language system method; calculating fitness values for multiple ones of the plurality of method implementations, each fitness value indicating a fitness of a respective one of the plurality of method implementations relative to the first language system method call; selecting a second language system method implementation from the plurality of method implementations, the selecting based on the interacting, and the selecting performed by the computing device, wherein the selecting is performed based on the calculated fitness values; the selecting comprises; identifying, for each parameter of the output signature of the first language system method call, a parameter dimensionality; and determining a corresponding dimensionality in a corresponding parameter in the output signature of the second language system method, comprising determining a dimensionality that is higher than the parameter dimensionality of the parameter of the output signature of the first language system method call.
-
-
21. A computer-readable non-transitory storage medium storing instructions, the instructions comprising:
one or more instructions that, when executed by a processor of a computer, cause the processor to; receive a signature of a first language system method call, the first language system method call originating in a first language system; analyze the signature of the first language system method call; determine; zero or more input parameters of the first language system method call, one or more output parameters of the first language system method call, an output signature of the first language system method call, wherein the output signature of the first language system method call comprises an indication of a number of the one or more output parameters of the first language system method call, and an output signature of a second language system method, wherein the output signature of the second language system method comprises an indication of a number of output parameters of the second language system method; calculate fitness values for multiple ones of the plurality of method implementations, each fitness value indicating a fitness of a respective one of the plurality of method implementations relative to the first language system call; select the second language system method, wherein; the second language system method; is associated with a second language system distinct from the first language system, and is selected from among a plurality of method implementations in the second language system, and the selecting is performed based on the calculated fitness values; wherein the selecting of the second language system method implementation comprises; identifying a parameter type for each output parameter of the output signature of the first language system method call; and for each identified parameter type determining a type capable of accepting the identified parameter type in the output signature of the second language system method by determining a casting type into which the identified parameter type may be cast without a loss of information; map the first language system method call to the second language system method, wherein the mapping comprises casting the identified parameter type into the determined casting type, the mapping used when calling the second language system method in response to the first language system method call.
-
22. A system comprising:
-
a storage for storing instructions that, when executed by one or more processors, cause the one or more processors to choose, based on a method call in a first language system, a corresponding method in a second language system distinct from the first language system; and a processor for determining an output signature of the first language system method call, wherein the output signature of the first language system method call comprises an indication of a number of the one or more output parameters of the first language system method call; receiving a signature of the first language system method call; analyzing the signature of the first language system method call to determine; zero or more input parameters of the first language system method call, and one or more output parameters of the first language system method call; determining an output signature of a second language system method, wherein the output signature of the second language system method comprises an indication of a number of output parameters of the second language system method; calculating fitness values for multiple ones of the plurality of method implementations, each fitness value indicating a fitness of a respective one of the plurality of method implementations relative to the first language system method call; selecting the second language system method, wherein; the second language system method is selected from among a plurality of method implementations in the second language system, and the selecting is performed based on the calculated fitness values; the selecting comprises; identifying, for each parameter of the output signature of the first language system method call, a parameter dimensionality; and determining a corresponding dimensionality in a corresponding parameter in the output signature of the second language system method, comprising determining a dimensionality that is higher than the parameter dimensionality of the output signature of the first language system method call; and mapping the first language system method call to the second language system method, the mapping used when calling the second language system method in response to the first language system method call.
-
-
23. A non-transitory computer readable storage medium storing instructions, the instructions comprising:
-
one or more instructions that, when executed by a processor of a computer, cause the processor to; receive a signature of a first language system method call, the first language system method call originating in a first language system, and the receiving performed by a computing device; analyze the signature of the first language system method call, the analyzing performed by the computing device; determine; zero or more input parameters of the first language system method call, and one or more output parameters of the first language system method call, where; the determining is based on the analyzing, the determining is performed by the computing device, and an output signature of the first language system method call, wherein the output signature of the first language system method call comprises an indication of a number of the one or more output parameters of the first language system method call; and interact with a second language system, the second language system including a plurality of method implementations, the second language system including a second language, the second language system being distinct with respect to the first language system, and the interacting performed by the computing device; determine an output signature of a second language system method, wherein the output signature of the second language system method comprises an indication of a number of output parameters of the second language system method, calculate fitness values for multiple ones of the plurality of method implementations, each fitness value indicating a fitness of a respective one of the plurality of method implementations relative to the first language system method call; select a second language system method implementation from the plurality of method implementations, the selecting based on the interacting, and the selecting performed by the computing device, wherein the selecting is performed based on the calculated fitness values; the selecting comprises; identifying, for each parameter of the output signature of the first language system method call, a parameter dimensionality; and determining a corresponding dimensionality in a corresponding parameter in the output signature of the second language system method, comprising determining a dimensionality that is higher than the parameter dimensionality of the output signature of the first language system method call; and determine a dimensionality that is higher than the parameter dimensionality of the parameter of the output signature of the first language system method call.
-
Specification