Automated Microservice API Generation via Semantic Wrappers

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Refactoring a monolith application into microservices poses challenges such as exposing endpoints for software functions while preserving semantics, handling object references, and adhering to Open API standards, which existing techniques have failed to address effectively.

Innovation Solution

The method involves analyzing software classes of microservices to identify eligible software functions for conversion to API format, generating deployable source code implementing APIs that expose these functions, and using software wrappers to encapsulate semantics, thereby replacing object passing techniques with object identifier passing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual refactoring of monolith applications into microservices is performed, then semantic preservation and object reference handling can be achieved, but the complexity and time consumption increase significantly

Engineering Contradiction:
Improvesemantic preservationVSAvoidrefactoring complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system performs automated analysis of software classes, automatic identification of eligible functions for API conversion, and automated generation of wrapper classes and client code. This self-service automation eliminates manual refactoring efforts while preserving semantics through structured analysis of class relationships, method signatures, and object references.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

Wrapper classes are introduced as intermediary components between existing microservice code and API interfaces. These wrappers encapsulate object references and semantically preserve the original monolith application behavior while enabling microservice communication through standardized API contracts, thus resolving the complexity of direct refactoring.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If automated API generation is implemented, then productivity increases, but the precision of semantic preservation may deteriorate

Engineering Contradiction:
Improverefactoring speedVSAvoidsemantic conversion accuracy
Core Design Contradiction:
ProductivityVSManufacturing precision

Solution Approach 1:

The system performs preliminary analysis of software classes to identify eligible functions for API conversion before generating code. This preliminary action includes analyzing class relationships, method signatures, object references, and dependencies to ensure that the automated generation process preserves semantic meaning accurately while maintaining high productivity.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

Wrapper classes serve as intermediaries that automatically translate between the original monolith application's object-oriented semantics and the target microservice API interfaces. This intermediary layer ensures precise semantic preservation during automated conversion by maintaining object reference integrity and method behavior fidelity.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Ease of operation

If object passing techniques are used in monolith applications, then communication between components is efficient, but converting to microservices requires complex object reference handling

Engineering Contradiction:
Improvecomponent communicationVSAvoidobject reference management
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

Wrapper classes act as intermediaries that automatically manage object references when converting from monolith to microservice architecture. These wrappers encapsulate the complexity of object reference handling by translating direct object passing in the original code into API-based communication between microservices, thus maintaining ease of operation while reducing reference management complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system extracts object reference management logic from the core business code and places it into dedicated wrapper classes. This extraction isolates the complexity of microservice communication and object reference handling into separate components, allowing the main application logic to remain simple and focused on business functionality.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS12293241B2Automated generation of application programming interfaces for microservices
Publication Date: 2025.05.06 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US12293241B2 patent drawing
  • US12293241B2 patent drawing
  • US12293241B2 patent drawing

AI summary

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.