Automatically identifying application programming interfaces based on application artifacts
One or more application programming interfaces to be implemented for an application are automatically identified. The automatically identifying includes determining within the application one or more artifacts to be implemented as the one or more application programming interfaces. For an artifact of the one or more artifacts, one or more requests of the artifact are determined. The one or more requests are part of an application programming interface signature for an application programming interface identified based on the artifact. For an application programming interface identified based on the artifact, one or more definitions are generated. The one or more definitions include one or more definitions for the one or more requests of the artifact.
1 . A computer-implemented method of facilitating processing within a computing environment, the computer-implemented method comprising:
automatically identifying, using a computing device of the computing environment, one or more application programming interfaces to be implemented for an application, wherein the automatically identifying includes determining within the application one or more artifacts to be implemented as the one or more application programming interfaces;
determining, for an artifact of the one or more artifacts, one or more requests of the artifact, the one or more requests being a part of an application programming interface signature for an application programming interface identified based on the artifact, and wherein the determining the one or more requests of the artifact includes automatically selecting, based on a control flow of the application and a type of program calls of the application, an analysis technique to be used to determine the one or more requests, wherein the analysis technique is automatically selected from a set of analysis techniques including a static with call chain analysis technique and a static without call chain analysis technique;
performing byte alignment on code of a code block of the artifact to identify how information is to be transferred between the application and the application programming interface; and
generating, for the application programming interface identified based on the artifact, one or more definitions, the one or more definitions including one or more request definitions for the one or more requests of the artifact.
2 . The computer-implemented method of claim 1 , further comprising determining for the artifact one or more responses of the artifact, and wherein the one or more definitions include one or more response definitions for the one or more responses.
3 . The computer-implemented method of claim 1 , wherein the artifact is one artifact selected from a group of artifacts consisting of transactions, screens, procedures, data access, rules and program calls.
4 . The computer-implemented method of claim 1 , further comprising refactoring by executing program instructions stored in memory, calling code of the application to modify the application to call the one or more application programming interfaces instead of original code of the application.
5 . The computer-implemented method of claim 1 , further comprising identifying, for the artifact, code to be exposed for the application programming interface identified based on the artifact, and wherein the determining includes determining, based on the code, the one or more requests and one or more responses for the artifact.
6 . The computer-implemented method of claim 5 , wherein the determining the one or more responses comprises selecting, based on the control flow of the application, a technique to be used to determine the one or more responses.
7 . The computer-implemented method of claim 6 , wherein the determining the one or more responses further comprises using the technique to automatically determine the one or more responses.
8 . The computer-implemented method of claim 6 , wherein the technique includes the static with call chain analysis technique based on the application having a defined type of program calls.
9 . The computer-implemented method of claim 6 , wherein the technique includes the static without call chain analysis technique based on the application having a determined type of program calls.
10 . The computer-implemented method of claim 1 , further comprising:
determining one or more arguments of a calling program defined from the application;
determining one or more parameters of artifact code of at least one artifact of the one or more artifacts; and
performing byte alignment between the one or more arguments and the one or more parameters to align the calling program and a called program that includes the artifact code.
11 . The computer-implemented method of claim 1 , further comprising, based on performing the selected analysis technique, determining, for the artifact, one or more responses of the artifact, and wherein the determining the one or more requests comprises using a liveness analysis to identify variables that are read without a preceding write, and wherein the determining the one or more responses includes using a reaching definitions analysis to identify variables that are written and read after return from a path of the application programing interface.
12 . A computer system for facilitating processing within a computing environment, the computer system comprising:
a memory; and
a computing device in communication with the memory, wherein the computer system is configured to perform a method, said method comprising:
automatically identifying, using the computing device, one or more application programming interfaces to be implemented for an application, wherein the automatically identifying includes determining within the application one or more artifacts to be implemented as the one or more application programming interfaces;
determining, for an artifact of the one or more artifacts, one or more requests of the artifact, the one or more requests being a part of an application programming interface signature for an application programming interface identified based on the artifact and wherein the determining the one or more requests of the artifact includes automatically selecting, based on a control flow of the application and a type of program calls of the application, an analysis technique to be used to determine the one or more requests, wherein the analysis technique is automatically selected from a set of analysis techniques including a static with call chain analysis technique and a static without call chain analysis technique;
performing byte alignment on code of a code block of the artifact to identify how information is to be transferred between the application and the application programming interface; and
generating, for the application programming interface identified based on the artifact, one or more definitions, the one or more definitions including one or more request definitions for the one or more requests of the artifact.
13 . The computer system of claim 12 , wherein the method further comprises determining for the artifact one or more responses of the artifact, and wherein the one or more definitions include one or more response definitions for the one or more responses.
14 . The computer system of claim 12 , wherein the method further comprises refactoring, by executing program instructions stored in memory, calling code of the application to modify the application to call the one or more application programming interfaces instead of original code of the application.
15 . The computer system of claim 12 , wherein the method further comprises identifying, for the artifact, code to be exposed for the application programming interface identified based on the artifact, and wherein the determining includes determining, based on the code, the one or more requests and one or more responses for the artifact.
16 . A computer program product for facilitating processing within a computing environment, the computer program product comprising:
one or more computer readable storage media and program instructions collectively stored on the one or more computer readable storage media to perform a method comprising:
automatically identifying, using a computing device of the computing environment, one or more application programming interfaces to be implemented for an application, wherein the automatically identifying includes determining within the application one or more artifacts to be implemented as the one or more application programming interfaces;
determining, for an artifact of the one or more artifacts, one or more requests of the artifact, the one or more requests being a part of an application programming interface signature for an application programming interface identified based on the artifact, and wherein the determining the one or more requests of the artifact includes automatically selecting, based on a control flow of the application and a type of program calls of the application, an analysis technique to be used to determine the one or more requests, wherein the analysis technique is automatically selected from a set of analysis techniques including a static with call chain analysis technique and a static without call chain analysis technique;
performing byte alignment on code of a code block of the artifact to identify how information is to be transferred between the application and the application programming interface; and
generating, for the application programming interface identified based on the artifact, one or more definitions, the one or more definitions including one or more request definitions for the one or more requests of the artifact.
17 . The computer program product of claim 16 , wherein the method further comprises determining for the artifact one or more responses of the artifact, and wherein the one or more definitions include one or more response definitions for the one or more responses.
18 . The computer program product of claim 16 , wherein the method further comprises refactoring, by executing program instructions stored in memory, calling code of the application to modify the application to call the one or more application programming interfaces instead of original code of the application.
19 . The computer program product of claim 16 , wherein the method further comprises identifying, for the artifact, code to be exposed for the application programming interface identified based on the artifact, and wherein the determining includes determining, based on the code, the one or more requests and one or more responses for the artifact.
20 . The computer program product of claim 19 , wherein the determining the one or more responses comprise selecting, based on the control flow of the application, a technique to be used to determine the one or more responses.