Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Java code generating method

A code generation and code technology, applied in the field of Java code generation, can solve the problems of introducing custom identifiers, retrieval, exceptions, and inability to classify and generate in the database model stage, achieving strong reusability, improving development efficiency, and maintainability. high effect

Inactive Publication Date: 2013-12-25
中电福富信息科技有限公司
View PDF4 Cites 39 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the existing active code generation method is directly performed through the database table, starting from the database table to parse, it must be converted into a table creation script corresponding to a certain database to create a database, which requires the code generation method to be adapted to a variety of mainstream database
In addition, although the code can be generated separately for a single newly added database table, all the generated codes are mixed and placed in packages at various levels, and cannot be generated according to the data correlation sub-package classification, and it is not easy to introduce custom identification in the database model stage , retrieval, exception and other logic

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Java code generating method
  • Java code generating method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0029] see figure 1 , a Java code generation method, the method needs to provide a template module, a data analysis module, a code generation module and a data module, a source code automatic generation script and a database initialization generation script are defined in the code generation module;

[0030] The specific method of operation of the Java code generation method is as follows:

[0031] Step 10: Define the metadata to form a metadata file in XML document format, and store it in the data module, that is, store it in the src directory, which stores the source code files described below by default in software development place; the metadata file is an XML document format file, which is convenient for people to write and view. The metadata is used to describe the data structure, the elements in the database, and the data of the relationship information between the elements. The metadata is used to describe the data and its environment. The present invention controls c...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a Java code generating method. In the method, a template module, a data analyzing module, a code generating module and a data module are needed, and an automatic source code generating script is defined in the code generating module. A specific operating method comprises the following steps: extracting metadata, defining the metadata to form a metadata file, and storing in the data module; extracting the metadata file by using the data analyzing module, analyzing the metadata, acquiring the code template from the template module, and converting the metadata into a template object, wherein the code template is provided with a named parameter used for identifying the template object; and executing the automatic source code generating script by using the code generating module, assigning the named parameter in the code template by using the template object to generate a plurality of source code files, and storing the source code files at positions corresponding to the metadata file in the data module. The Java code generating method has the advantages of high maintainability, high code consistency, high reusability, higher development efficiency and lower manpower cost.

Description

technical field [0001] The invention specifically relates to a Java code generation method. Background technique [0002] Existing code generation methods are generally divided into two categories: passive code generation methods and active code generation methods. In the passive code generation method, a visual wizard is generally used to configure and generate part of the code, and then software developers make necessary edits and modifications to the code. This generation process is only performed once, and the modified code is not maintained; most of the current An Integrated Development Environment (IDE) or editor includes this method of code generation. However, the limitations of this code generation method are also obvious. The IDE or editor is only responsible for generating once, and the rest of the workload is the responsibility of the software developer. Regeneration will cover the modified code, and it is only applicable to some Scenarios, lack of configurabil...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/45
Inventor 陈华光徐舒延王涵刘雅文
Owner 中电福富信息科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products