IP Library Granted Patent US 12,293,241
Granted Patent B2
US 12,293,241 · App. 17/806,812 · Granted May 6, 2025

Automated generation of application programming interfaces for microservices

Inventors: Vini Kanvar (New Delhi, IN); Ridhi Jain (Jhansi, IN); Srikanth Govindaraj Tamilselvam (Chennai, IN); Amith Singhee (Bangalore, IN); Shivali Agarwal (Ghaziabad, IN)
Assignee: International Business Machines Corporation
G06F9/547
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,293,241
App. No.
17/806,812
Granted
May 6, 2025
Kind
B2
Abstract

Described are techniques for exposing an endpoint for a software function used by microservices. The techniques include obtaining software classes of a plurality of microservices and analyzing the software classes to identify a software function that is eligible for conversion to an application programming interface (API) format. The techniques further include determining a server microservice, which hosts a software class that includes the software function, and one or more client microservices that use the software function. The techniques further include generating deployable source code implementing an API that exposes the software function hosted by the server microservice to the one or more client microservices. The API uses a software wrapper to encapsulate software function semantics used by a monolith application refactored into the plurality of microservices.

Claims (50)

1. A computer-implemented method, comprising:

obtaining software classes of a plurality of microservices, wherein each microservice comprises one or more software classes;

analyzing the software classes of the plurality of microservices to identify a cross-microservice dependency on a software function that cannot be resolved by moving the software function to a single microservice, which makes the software function eligible for conversion to an application programming interface (API) format that exposes the software function to client microservices that depend on the software function;

determining, a server microservice to host a software class that includes the software function, and one or more client microservices that depend on the software function; and

generating deployable source code implementing an API that exposes the software function hosted by the server microservice to the client microservices that depend on the software function, wherein the API uses a software wrapper to encapsulate software function semantics used by a monolith application which has been refactored into the plurality of microservices.

2. The method of claim 1 , wherein generating the deployable source code that implements the API further comprises:

generating a server API package to deploy to the server microservice containing server-side API components that enable the server microservice to receive calls to execute the software function included in the software class of the server microservice; and

generating a client API package to deploy to the client microservice containing client-side API components that enable the client microservice to call the software function included in the software class of the server microservice.

3. The method of claim 2 , wherein generating the server API package and the client API package further comprises:

creating a server wrapper class to include instructions that expose the software function to the one or more client microservices, and to encapsulate legacy source code used by the monolith application to execute the software function; and

creating a client wrapper class to include instructions for calling the software function using the API, and to include legacy source code used by the monolith application to call the software function.

4. The method of claim 3 , wherein the server wrapper class and the client wrapper class replace an object passing technique used by the monolith application with an object identifier passing technique, comprising:

creating, by the server microservice, an object and a unique object identifier in response to a request from the client microservice, and managing the object using resources of the server microservice, and

providing, by the client microservice, the unique object identifier to the server microservice with requests to access the object managed on the resources of the server microservice.

5. The method in claim 1 , wherein the software function semantics encapsulated in the software wrapper include semantics for overriding the software function.

6. The method in claim 1 , wherein the API for the software function is selected from a group of API protocols consisting of: an open API protocol, a representational state transfer (REST) API protocol, a simple object access protocol (SOAP), and a remote procedure call (RPC) protocol.

7. A system, comprising:

one or more computer readable storage media storing program instructions; and

one or more processors which, in response to executing the program instructions, are configured to:

refactor a monolith application into a plurality of microservices that comprise one or more software classes;

analyze the software classes of the plurality of microservices to identify a cross-microservice dependency on a software function that cannot be resolved by moving the software function to a single microservice, which makes the software function eligible for conversion to an application programming interface (API) format that exposes the software function to client microservices that depend on the software function;

determine a server microservice, which hosts a software class that includes the software function, and one or more client microservices that depend on the software function; and

generate deployable source code implementing an API that exposes the software function hosted by the server microservice to the client microservices that depend on the software function, wherein the API uses a software wrapper to encapsulate software function semantics used by the monolith application refactored into the plurality of microservices.

8. The system of claim 7 , wherein the program instructions that, when executed by the one or more processors, generate the deployable source code that implements the API further configure the one or more processors to:

generate a server API package to deploy to the server microservice containing server-side API components that enable the server microservice to receive calls to execute the software function included in the software class of the server microservice; and

generate a client API package to deploy to the client microservice containing client-side API components that enable the client microservice to call the software function included in the software class of the server microservice.

9. The system of claim 8 , wherein the program instructions that, when executed by the one or more processors generate the server API package and the client API package further configure the one or more processors to:

create a server wrapper class to include instructions that expose the software function to the one or more client microservices, and to encapsulate legacy source code used by the monolith application to execute the software function; and

create a client wrapper class to include instructions for calling the software function using the API, and to include legacy source code used by the monolith application to call the software function.

10. The system of claim 9 , wherein the server wrapper class and the client wrapper class replace an object passing technique used by the monolith application with an object identifier passing technique, comprising:

creating, by the server microservice, an object and a unique object identifier in response to a request from the client microservice, and managing the object using resources of the server microservice, and

providing, by the client microservice, the unique object identifier to the server microservice with requests to access the object managed on the resources of the server microservice.

11. The system of claim 7 , wherein the software function semantics encapsulated in the software wrapper include semantics for overriding the software function.

12. The system of claim 7 , wherein the API for the software function is selected from a group of API protocols consisting of: an open API protocol, a representational state transfer (REST) API protocol, a simple object access protocol (SOAP), and a remote procedure call (RPC) protocol.

13. A 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, the program instructions comprising instructions configured to cause one or more processors to:

refactor a monolith application into a plurality of microservices that comprise one or more software classes;

analyze software classes of the plurality of microservices to identify a cross-microservice dependency on a software function by two or more of the plurality of microservices, where the cross-microservice dependency cannot be resolved by moving the software function to a single microservice;

determine a server microservice, which hosts a software class that includes the software function, and one or more client microservices that use the software function; and

generate deployable source code implementing an application programming interface API that exposes the software function hosted by the server microservice to the client microservices that depend on the software function, wherein the API uses a software wrapper to encapsulate software function semantics used by the monolith application refactored into the plurality of microservices.

14. The computer program product of claim 13 , wherein the instructions configured to cause the one or more processors to generate the deployable source code that implements the API further:

generate a server API package to deploy to the server microservice containing server-side API components that enable the server microservice to receive calls to execute the software function included in the software class of the server microservice; and

generate a client API package to deploy to the client microservice containing client-side API components that enable the client microservice to call the software function included in the software class of the server microservice.

15. The computer program product of claim 14 , wherein the instructions configured to cause the one or more processors to generate the server API package and the client API package further:

create a server wrapper class to include instructions that expose the software function to the one or more client microservices, and to encapsulate legacy source code used by the monolith application to execute the software function; and

create a client wrapper class to include instructions for calling the software function using the API, and to include legacy source code used by the monolith application to call the software function.

16. The computer program product of claim 15 , wherein the server wrapper class and the client wrapper class replace an object passing technique used by the monolith application with an object identifier passing technique, comprising:

creating, by the server microservice, an object and a unique object identifier in response to a request from the client microservice, and managing the object using resources of the server microservice, and

providing, by the client microservice, the unique object identifier to the server microservice with requests to access the object managed on the resources of the server microservice.

17. The computer program product of claim 13 , wherein the instructions configured to cause the one or more processors to analyze the software classes of the plurality of microservices further:

receive mapping information via a user interface identifying the software function that is used by two or more of the plurality of microservices, wherein the user interface enables a user to specify a software function in source code of a monolith application and map the software function to one or more software classes in the source code of the monolith application that depend on the software function.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 14, 2022
From: KANVAR, VINI; JAIN, RIDHI; TAMILSELVAM, SRIKANTH GOVINDARAJ; SINGHEE, AMITH; AGARWAL, SHIVALI
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 060193/0787 →
Continuity (1)
Related Publication 20230409417A1 · Dec 21, 2023
References Cited (16)
US 10430250B2 · Ishikawa · 2019 [cited by examiner]
US 10579370B2 · Gupta · 2020 [cited by applicant]
US 10841392B2 · Walsh · 2020 [cited by applicant]
US 10936291B1 · Gamliel · 2021 [cited by examiner]
US 20200401386A1 · Punathil · 2020 [cited by examiner]
US 20210011688A1 · Sasidharan · 2021 [cited by examiner]
US 20210029001A1 · Sen · 2021 [cited by examiner]
US 20210124577A1 · Gupta · 2021 [cited by examiner]
Koschel et al., “Making the Move to Microservice Architecture” (Jul. 17-19, 2017), 2017 International Conference on Information Society (i-Society), pp. 74-79, [retrieved from https://ieeexplore.ieee.org/abstract/docume… [cited by examiner]
Zaragoza et al., “Refactoring Monolithic Object-Oriented Source Code to Materialize Microservice-oriented Architecture” (Jul. 2021), ICSOFT 2021—16th International Conference on Software Technologies, Jul. 2021, pp. 78-… [cited by examiner]
Banerjee., “Understanding the Advantages of Using IBM Mono2Micro to Automate Application Refactoring”, IBM Developer, Aug. 27, 2020, 10 Pgs, <https://developer.ibm.com/articles/advantages-of-using-ibm-mono2micro . . . >. [cited by applicant]
Dehghani., “How to break a Monolith into Microservices”, Apr. 24, 2018, 17 Pgs, <https://martinfowler.com/articles/break-monolith-into-microservices.html#MinimizeDependencyBackToTheMonolith>. [cited by applicant]
Google Cloud, “Refactoring a Monolith Into Microservices”, Access on May 9, 2022, 15 Pgs, <https://cloud.google.com/architecture/microservices-architecture-refactoring-monoliths>. [cited by applicant]
Jin et al., “Functionality-Oriented Microservice Extraction Based on Execution Trace Clustering”, ResearchGate, Conference 2018:IEEE International Conference on Web Services (ICWS),, Jul. 2018, DOI:10.1109/ICSW.2018.000… [cited by applicant]
Mell et al., “The NIST Definition of Cloud Computing”, National Institute of Standards and Technology, Special Publication 800-145, Sep. 2011, 7 pages. [cited by applicant]
Theivendra., “IBM Mono2Micro: AI-driven refactoring of monoliths to microservices for WebSphere Liberty”, IBM, May 4, 2021, 8 Pgs, <https://community.ibm.com/community/user/wasdevops/blogs/leonard-theivendra1/2021/04/06… [cited by applicant]
Cited By (1)
US 12,717,556