Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Template-based Code Fragment Generation with XML

IP.com Disclosure Number: IPCOM000129305D
Original Publication Date: 2005-Oct-05
Included in the Prior Art Database: 2005-Oct-05
Document File: 8 page(s) / 169K

Publishing Venue

IBM

Abstract

A program is disclosed that would allow for programmatic generation of Java code fragments from graphical metadata. The logic of how the Java code is generated is governed by a set of XML code generation template. The generated Java code fragment can be directly used anywhere Java code fragment can be used in any Java VM.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 28% of the total text.

Page 1 of 8

Template-based Code Fragment Generation with XML

Invention Summary:

This invention is a translation engine which provides Java code fragment generation service for client application. The engine can accept, as its input, one or more set of input data from a client application and translate it into corresponding a Java code fragment. The translation engine uses a set of XML documents to govern what kind of translation can be done as well as how the translation should be done.

The following are the steps that the engine uses to provide the Java code fragment generation service. Details on these steps will be described later in this document:

1. Translation engine starts.
2. Translation engine is initialized with one or more XML code generation templates.
3. Translation engine is ready to provide Java code fragment generation service for client application.
4. Client application sends input data to translation engine for code generation.
5. Translation engine analyzes the input data and their relationships.
6. Translation engine uses the corresponding code generation template to generate a Java code fragment.
7. Translation engine returns the generated Java code fragment to the client application.

Invention Capabilities:

The invention is able to handle situations for both simple and complex code-generation requirements. In a simple case, one set of input data is provided to the translation engine, and the Java code fragment is generated based on the input data. In a more complex scenario, one or more sets of input data, along with the relationships between these input data, is provided to the translation engine. The translation engine will analyze the input data and relationship, and generate appropriate Java code fragment for the input data. The following diagrams describe these two situations in more detail:

1. One set of input data is passed into the translation engine, which returns the appropriate Java-code fragment.

1

[This page contains 1 picture or other non-text object]

Page 2 of 8

2. One or more sets of input data, plus the relationship or linkage between these input data is passed into the translation engine, which returns the appropriate Java-code fragment.

Invention Advantage:

- Scalable

New types of required code fragment can be added to any of the configuration files. Since the fragment template is located in a separated file, any changes required in the fragment template can be made in this file, and there will be no need to produce and release a new program executable.

- Extensible

Since the translation engine will query a registry to discover available code template configuration files at runtime, when other components wish to add new code fragments for use by the translation engine, they simply have to produce their own configuration file and register with the translation engine. At runtime, when the translation engine starts, it will then query these other registered components for their configuration files and will co...