Server-Side Compilation of Embedded Java Code in JavaScript

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

JavaScript development is hindered by the lack of a compiler, making it complex to write and debug, and compiling code at the client can interfere with the dynamicity and portability of web pages.

Innovation Solution

Embedding compiled Java code within JavaScript code, allowing a server-based processing unit to extract and compile it, generating executable code and replacing the embedded Java code with a service call, thus preserving dynamicity and portability while providing robustness.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If JavaScript code is used without a compiler, then web pages maintain dynamicity and portability, but code becomes complex to write and debug

Engineering Contradiction:
Improveease of writing and debuggingVSAvoidcode complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent introduces a server-side intermediary component that compiles embedded Java code and generates JavaScript code automatically. This intermediary eliminates the need for developers to manually write and debug complex compiled code while maintaining the dynamicity of JavaScript, thus resolving the contradiction between ease of operation and code complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system enables self-service by automatically extracting embedded Java code, compiling it, and generating corresponding JavaScript code without developer intervention. The server-side processor handles the compilation and code generation autonomously, allowing developers to simply embed Java code and receive optimized JavaScript output.

Inventive Principle:
Principle #25Self-service

2Speed

If compiled code is executed on the client, then execution speed improves, but the client is burdened with compilation tasks

Engineering Contradiction:
Improvecode execution speedVSAvoidclient processing burden
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The patent extracts the compilation process from the client and relocates it to the server. The server-side processor extracts embedded Java code, compiles it, and generates JavaScript code that is then sent to the client. This extraction eliminates the compilation burden from the client while maintaining fast execution speed through pre-compilation.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The system performs preliminary compilation action on the server before the code is sent to the client. By compiling the Java code in advance and generating optimized JavaScript code on the server, the system prepares executable code that can run quickly on the client without requiring the client to perform compilation tasks.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If embedded Java code is extracted and compiled on the server, then code robustness improves, but server processing requirements increase

Engineering Contradiction:
Improvecode robustnessVSAvoidserver processing power
Core Design Contradiction:
ReliabilityVSPower

Solution Approach 1:

The patent applies partial action by extracting and compiling only the embedded Java code portions rather than the entire webpage. The server-side processor identifies and processes only the Java code segments embedded in JavaScript files, leaving the rest of the JavaScript code unchanged. This partial processing approach provides robustness where needed while minimizing server processing requirements.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS8443345B2Dynamic processing of embedded compiled programming language code
Publication Date: 2013.05.14 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US8443345B2 patent drawing
  • US8443345B2 patent drawing
  • US8443345B2 patent drawing

AI summary

Development using the JavaScript programming language can be limited since JavaScript code is interpreted. Compiling code at a client may interfere with the dynamicity and portability of web pages. Dynamicity and portability of web pages can be preserved while providing the features of a compiled programming language. A compiled programming language code can be embedded within an interpreted programming language code. The embedded compiled programming language code can be extracted and compiled with resources of a server to deliver the robustness and flexibility of the compiled programming language without burdening a client with compiling.