Code Generation Engine for API Development

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing API description languages are inflexible and incapable of direct compilation, leading to rigid, verbose, and suboptimal source code that can result in memory consumption, performance issues, and errors during runtime.

Innovation Solution

A code-generation engine that automatically generates source code for APIs using definition data in a description language and template data in a templating language, allowing for customization and translation between programming languages, producing tailored and precise source code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If API description languages are used to facilitate API creation, then development time is minimized and standardization is achieved, but the generated source code becomes rigid, verbose, and suboptimal

Engineering Contradiction:
ImproveAPI development timeVSAvoidsource code quality
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent introduces a code generation engine as an intermediary between the API description language and the final source code. This engine takes the standardized description language input and transforms it into optimized, language-specific source code by applying templates and customization rules, thereby resolving the conflict between standardization and code quality

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system allows dynamic customization of code generation parameters through templates and configuration files. By changing parameters such as programming language target, coding standards, and specific implementation details, the same API description can generate optimized source code adapted to different requirements, preventing rigidity and verbosity

Inventive Principle:
Principle #35Parameter changes

2Productivity

If description languages are designed to minimize development time, then they become limited and inflexible, but this reduces the customizability of the API

Engineering Contradiction:
Improvedevelopment timeVSAvoidAPI customizability
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The code generation process is segmented into multiple stages: parsing the API description language, applying templates, customizing parameters, and generating final code. This segmentation allows the system to maintain the efficiency of standardized description languages while incorporating customization at specific stages without compromising development speed

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system introduces dynamic template selection and parameter customization that adapt to different API requirements. The code generation engine can dynamically adjust generation strategies based on the specific API being created, maintaining both speed and flexibility through adaptive rather than static generation rules

Inventive Principle:
Principle #15Dynamics

3Ease of manufacture

If generic code generation tools are used, then conversion from description language to compilable source code is achieved, but the source code becomes rigid, verbose, over-inclusive or under-inclusive, and unstable

Engineering Contradiction:
Improvecode conversion capabilityVSAvoidsource code stability
Core Design Contradiction:
Ease of manufactureVSReliability

Solution Approach 1:

The patent implements local quality optimization by applying different templates and customization rules to different parts of the generated code based on specific requirements. Rather than using uniform generic generation rules, the system tailors code generation to local context, producing stable and appropriate code for each specific API scenario

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The code generation engine incorporates feedback mechanisms where generated code can be validated against requirements and templates, allowing for iterative refinement. This feedback loop ensures that the generated source code meets stability and quality standards before final output, preventing the propagation of rigid and unstable code patterns

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS10545730B2Automatically generating code for application programming interfaces
Publication Date: 2020.01.28 RED HAT INC
  • US10545730B2 patent drawing
  • US10545730B2 patent drawing
  • US10545730B2 patent drawing

AI summary

Code for an application programming interface (API) can be automatically generated. For example, a processing device can receive a definition data describing functional and behavioral characteristics of the API in an API description language. The processing device can also receive a template data defining code logic for the API. The template data can include (i) template code in a template language, and (ii) program code in a programming language that is different from the template language and the API description language. The processing device can generate source code in the programming language using the template data and the definition data by performing operations in accordance with the template code. The operations can include at least replacing template variables with corresponding values from the definition file. The processing device can then compile the source code into an executable file, and execute the executable file to implement the API.