Java to .NET Source Code Translator via Abstraction Layers

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for automatically translating Java source code into .NET languages, such as C# and VB.NET, face challenges due to significant differences between Java and .NET class library interfaces, leading to errors and inefficiencies, as seen in tools like JConvert, which struggle to convert library calls effectively.

Innovation Solution

The implementation provides abstraction layers through Java and .NET Open Foundation class libraries that present identical interfaces, allowing Java source code to be translated into .NET languages without modifying existing class library calls, and generating Microsoft Intermediate Language code using these abstraction layers.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If source code translation tools attempt to convert all Java class library calls to equivalent .NET class library calls, then translation completeness is improved, but translation accuracy deteriorates due to interface differences between Java and .NET libraries

Engineering Contradiction:
Improvetranslation completenessVSAvoidtranslation accuracy
Core Design Contradiction:
ProductivityVSManufacturing precision

Solution Approach 1:

The patent introduces an intermediary translation layer that maps Java class library calls to a standardized intermediate representation, which is then mapped to .NET class library calls. This intermediary layer acts as a mediator that handles the interface differences between Java and .NET libraries, allowing complete translation while maintaining accuracy by managing the complexity of interface mappings systematically.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The translation process is segmented into distinct phases: parsing Java source code, identifying class library calls, translating to intermediate representation, and generating .NET code. By segmenting the translation process, the system can handle different types of calls with appropriate strategies, improving both completeness and accuracy.

Inventive Principle:
Principle #1Segmentation

2Adaptability or versatility

If developers write applications from scratch in multiple languages to accommodate customer preferences, then language compatibility is improved, but development resources deteriorate

Engineering Contradiction:
Improvelanguage compatibilityVSAvoiddevelopment resources
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent creates a universal translation framework that can translate Java source code to multiple .NET languages (C#, VB.NET, F#). This multi-functional translation system allows a single Java application to be adapted to different customer language preferences without requiring separate development efforts for each language, thus improving language compatibility while reducing development resources.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Speed

If existing translation tools like JConvert are used to convert Java source code to C#, then translation speed is improved, but translation reliability deteriorates due to failure to convert substantial number of library calls

Engineering Contradiction:
Improvetranslation speedVSAvoidtranslation reliability
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent introduces an intermediary translation layer that maps Java class library calls to a standardized intermediate representation, which is then mapped to .NET class library calls. This intermediary layer acts as a mediator that handles the interface differences between Java and .NET libraries, allowing complete translation while maintaining accuracy by managing the complexity of interface mappings systematically.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS7770158B2Source code translator
Publication Date: 2010.08.03 ORACLE INT CORP
  • US7770158B2 patent drawing
  • US7770158B2 patent drawing
  • US7770158B2 patent drawing

AI summary

A method, computer program product, and apparatus comprise providing a Java developer kit class library comprising first Java classes; providing a Java Open Foundation class library comprising second Java classes each containing one or more of the first Java classes; providing a .NET SDK class library comprising .NET classes; providing a .NET language Open Foundation class library comprising first .NET language classes each containing one or more of the .NET classes; wherein each of the .NET language classes presents the same method signature as one of the second Java classes; receiving Java source code defining third Java classes, first calls to the first Java classes, and second calls to the second Java classes; translating the third Java classes into second .NET language classes; and translating the first calls to calls into the .NET SDK class library without modifying the second calls.