CN102117202B - J2EE architecture-based code generating device - Google Patents

J2EE architecture-based code generating device Download PDF

Info

Publication number
CN102117202B
CN102117202B CN200910244278.2A CN200910244278A CN102117202B CN 102117202 B CN102117202 B CN 102117202B CN 200910244278 A CN200910244278 A CN 200910244278A CN 102117202 B CN102117202 B CN 102117202B
Authority
CN
China
Prior art keywords
attribute
file
configuration file
code
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN200910244278.2A
Other languages
Chinese (zh)
Other versions
CN102117202A (en
Inventor
陈兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New Founder Holdings Development Co ltd
Founder International Beijing Co Ltd
Original Assignee
Founder International Beijing Co Ltd
Peking University Founder Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Founder International Beijing Co Ltd, Peking University Founder Group Co Ltd filed Critical Founder International Beijing Co Ltd
Priority to CN200910244278.2A priority Critical patent/CN102117202B/en
Publication of CN102117202A publication Critical patent/CN102117202A/en
Application granted granted Critical
Publication of CN102117202B publication Critical patent/CN102117202B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a Java 2 enterprise edition (J2EE) architecture-based code generating device. The device comprises an attribute setting unit and an engine unit, wherein the attribute setting unit is used for setting a file attribute according to the received parameters and generating and outputting a corresponding configuration file; and the engine unit is used for acquiring and resolving the configuration file, selecting a corresponding code module according to the resolved file attribute and generating a code file. A componentized structure is adopted in the device, and the corresponding code file can be automatically generated through the parameters set by a user and configured to a platform by the user; and through the device, the time for editing the code file by the user is saved, the work efficiency of the user is improved, and the development period of the whole project is reduced.

Description

Code generating unit based on J2EE framework
Technical field
The present invention relates to field of computer technology, in particular to a kind of code generating unit based on J2EE framework.
Background technology
In software development industry, each company in long-term software development process, all formed a whole set of, perfect development platform, in this specification masks, safeguard and upgrade, greatly improved the standard of company, reduced cost of development simultaneously.
For software development, each project will be passed through demand, design, and exploitation, tests this four flow processs, and when Cost Accounting, often human cost is occupied first place, and human cost is mainly reflected in software developer's input, and also cost is very high.
In process for exploitation; all can form a corresponding development platform; especially adopt the platform of the language development of object-oriented thought; as language such as Java, C++, and software developer can rely on this platform, and the standard defining early stage is carried out to rule, heavy, customized pattern exploitation; exploitation for this part qualitative model; conventionally can take the time that open personnel are a lot, cause the construction cycle of whole project long, the problem that development efficiency is low.
Summary of the invention
The present invention aims to provide a kind of code generating unit based on J2EE framework, and the exploitation that it can solve for software operation qualitative model takies the time that open personnel are a lot, causes the construction cycle of whole project long, the problem that development efficiency is low.
According to an aspect of the present invention, provide a kind of code generating unit based on J2EE framework, comprising:
Setup of attribute unit, arranges file attribute for the parameter according to receiving, and generates corresponding configuration file output;
Engine unit, for obtaining described configuration file and resolving, selects corresponding code module according to the described file attribute parsing, and generating code file.
Preferably, also comprise:
Input-output unit, for the parameter from user being sent to described setup of attribute unit, exports the code file that described engine unit generates.
Preferably, described setup of attribute unit comprises:
Name attribute module, for according to user's parameter, arranges the name variable rule in file name rule and file, generates corresponding expandable mark language XML configuration file output;
Page properties module, for receiving user's parameter, arranges the page shape, the control type on the page, control color and the control layout that are shown to user, generates corresponding CSS (cascading style sheet) CSS configuration file output;
Database module, for receiving user's parameter, arranges the list structure, field attribute, major key attribute, the index attributes that on the described page, show, generates corresponding XML configuration file output.
Preferably, described database module comprises:
Table name attribute submodule, for receiving user's parameter, arranges the naming rule of described table, generates corresponding XML configuration file output;
Field attribute submodule, for receiving user's parameter, arranges the interior data type of each field in table and shows rule, generates corresponding XML configuration file output;
Major key attribute submodule, for receiving user's parameter, arranges the create-rule of major key in table, generates corresponding XML configuration file output;
Index attributes submodule, for receiving user's parameter, arranges the index in table, generates corresponding XML configuration file output.
Preferably, also comprise:
Data basd link connection module, for XML configuration file stores that described database module is generated to database;
Described engine unit, for obtaining described XML configuration file by described database.
Preferably, described engine unit comprises:
Database component, for receiving user's parameter, arranges and connects described data base configuration file;
Resolve attribute assembly, for obtaining the XML configuration file of the XML configuration file of described database preservation, the generation of described name attribute module and the CSS configuration file of described page properties module generation and resolving;
Code formation component, for selecting corresponding code module according to the described file attribute parsing, and generating code file.
Preferably, described engine unit, also comprises:
Configuration file assembly, is configured to predefined file for the code file that code formation component is generated.
Device of the present invention adopts Componentized structure, and the parameter arranging by user, can generate corresponding code file automatically, by user, is configured to platform; By device of the present invention, saved the time of user's edit code file, improved user's work efficiency, reduce the construction cycle of whole project.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms the application's a part, and schematic description and description of the present invention is used for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 shows the structural drawing of apparatus of the present invention embodiment;
Fig. 2 shows the graph of a relation between file in embodiment.
Embodiment
Below with reference to the accompanying drawings and in conjunction with the embodiments, describe the present invention in detail.
Device embodiment of the present invention adopts the design of object-oriented thought, and its structural drawing can, referring to Fig. 1, comprise:
Setup of attribute unit 11, arranges file attribute for the parameter according to receiving, and comprises the title of file and file content, type etc., generates corresponding configuration file output;
Engine unit 12, for obtaining described configuration file and resolving, selects corresponding code module generating code file according to described file attribute;
Input-output unit 13, for the parameter from user being sent to described setup of attribute unit, exports described code file.
User to setup of attribute unit input parameters, arranges the various attributes of file by peripheral hardware, comprising: name attribute, Database Properties, page properties etc.Modules in setup of attribute unit 11 is carried out corresponding setup of attribute according to parameter, comprises respectively:
Name attribute module 112, for receiving user's parameter-definition Naming conventions (definition of the definition of variable specifications, the definition of file, java bag) and arranging.
The variable naming of definition different types of data, data type comprises, integer, character type, date type, floating type (with radix point type).The main prefix of defining variable and the capital and small letter of initial, while being convenient to generating code by this regular naming variable.When configuration is complete, generate corresponding XML configuration file.
The name nominating rule of definition java class file and jsp file, each file name is fixed and is identical with the table name name of database 14, and initial capital and small letter defines from here.When configuration is complete, generate corresponding XML configuration file.
The name of definition java bag, each module can be in standard a corresponding java overall budget (for example, com.order.cc.app.user), under each overall budget, can have six attached bags, attached bag is without definition, and the attached bag under overall budget generates according to platform properties, relation between each class can be referring to Fig. 2, mainly comprise Form, action, Serivce, dao, idao, entity, each attached bag is responsible for the function that code is realized business separately, is described as follows:
Corresponding method entrance when action:jsp submits to.
The buffering of form:jsp and back-end data.
Entity: the entity file of related data object.
Dao: all database manipulations all will complete in this type of, forbidden data storehouse sq1 occurs in other classes.
The interface class of idao:dao.
Serivce: service logic realizes in this type of, links up with dao.
When generating certain module java class file, engine unit can generate corresponding class file under the attached bag of correspondence according to the overall budget of this module definition and platform properties under overall budget, and file generated is as follows:
Action class name form: the title+Action.java of module table
Form class name form: the title+Form.java of module table
Entity class name form: the title+Entity.java of module table
Dao class class name form: the title+DAO.java of module table
IDao class class name form: the title+DAO.java of I+ module table
Svc class class name form: the title+Serivce.java of module table
Database module 111, arranges the attribute of traffic table structure and data item and is kept at database 14 with the form of XML file for accepting user's parameter.Comprise table name attribute submodule 1101, field attribute submodule 1102, major key attribute submodule 1103, index attributes submodule 1104.
Table name attribute submodule 1101, for his-and-hers watches, name, definition table name naming rule, as subscriber's meter, can add corresponding name service word by prefix, prefix and the direct junction symbol of title implication word, these all need define at this, and for example Prefix Hierarchy Names is TB, and connector is combined into " _ ", business word title is UESER, and this table name is just defined as TB_USER.
Field attribute submodule 1102, for define field naming rule and title, field is mainly reflected in form class and entity class, jsp, the prefix of define field and junction symbol, prefix and junction symbol do not show in the file generating, mainly judge the label control that this field shows in the jsp page, prefix mainly comprises Txt (form with text box in the page embodies), com (form with combobox in the page embodies) date (form with time control in the page embodies) txtare (form with textview field in the page embodies).
Major key attribute submodule 1103, for receiving user's parameter, major key is set is automatically to generate or filled in by user, if automatically generated, the rule automatically generating, the mode of main sequence, the title of specified sequence.
Index attributes submodule 1104, arranges the file index of inquiry for receiving user's parameter, generate corresponding expandable mark language XML configuration file output, to improve search efficiency.
Page properties module 113, the structure of the page style sheet while feeding back to user for receiving user's parameter-definition, control type, control color, control layout etc., and be stored in database 14 with CSS (cascading style sheet) CSS document form with the definition standard of page style sheet.The file name of setting style sheet, is divided into two large classes, and query page and maintain pages can be specified respectively different style sheet, and style sheet also can directly be revised, and after modification, is directly saved under the path of the style sheet that platform is corresponding.The verifying function of script, for various field type, specifies different methods of calibration, and type comprises numeric type, date type, character type three major types, can associated corresponding method when generating jsp.
Also comprise, data basd link connection module 114, for connection data storehouse 14, the XML configuration file stores that database module in setup of attribute unit is generated is in database 14.
Describe the modules in setup of attribute unit 11 above in detail, the following describes modules and function in engine unit 12; Engine unit 12 comprises following each assembly and function:
1) database component 121, and for connection data storehouse 14, and reading database link module 114 is saved in the XML profile information of the traffic table in database 14.
To the database 14 that will use, can pass through interaction page, connection parameter is set, be saved in the XML file of appointment.In order to carry out the connection to this database in usage data storehouse.The database that can use by configuration, reads the traffic table information in this storehouse.
2) resolve attribute assembly 122, major function:
The XML configuration file that parsing is preserved in database, resolve the XML configuration file of described name attribute module generation and the CSS configuration file that described page properties module generates, after parsing, read and offer generating code assembly, generating code assembly generates corresponding code file according to the attribution rule of XML configuration file, CSS configuration definition.Resolution data storehouse configuration parameter, offers database and connects, and carries out the connection to database.
3) code formation component 123, major function:
To the traffic table of choosing, the standard rule parsing according to parsing attribute assembly generates corresponding code file, file mainly divides two classes, one class is corresponding java class file, another kind of is corresponding jsp pagefile, java file can be created under the src catalogue of platform automatically according to the bag name setting, and jsp file can be generated under the webroot catalogue under platform according to the title of overall budget.
4) configuration file assembly 124, major function:
Platform architecture adopts carries out programming development on the J2EE framework of SSH (Struts Spring Hibernate three's the combination) structure increase income, some configuration files that need on stream struts, Spring and hibernate, the java class that code formation component is generated and jsp file configuration are in these configuration files.
By device embodiment of the present invention, user is in the process of design software, first analyze business demand, determine and need to show which data, thereby the layout of the list structures such as corresponding file name, the field comprising, data type, page display content is set respectively by the modules in setup of attribute unit, set which field data need safeguard, in page display format, need operating function (increase, delete, change, look into) etc.;
After setting completes, setup of attribute unit can be saved in the parameter of setting in database with XML document form automatically, engine unit can pass through database component connection data storehouse, by resolving attribute assembly, read XML file and resolve, the standard being defined according to name attribute module by code formation component, the Java/Jsp code file of generation respective name; Finally by configuration file assembly, the code file of generation is configured in the file under corresponding platform.
Device of the present invention adopts Componentized structure, and the parameter arranging by user, can generate corresponding code file automatically, by user, is configured to platform; By device of the present invention, saved the time of user's edit code file, improved user's work efficiency, reduce the construction cycle of whole project.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby they can be stored in memory storage and be carried out by calculation element, or they are made into respectively to each integrated circuit modules, or a plurality of modules in them or step are made into single integrated circuit module to be realized.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (5)

1. the code generating unit based on J2EE framework, is characterized in that, comprising:
Setup of attribute unit, arranges file attribute for the parameter according to receiving, and generates corresponding configuration file output;
Engine unit, for obtaining described configuration file and resolving, selects corresponding code module according to the described file attribute parsing, and generating code file;
Input-output unit, for the parameter from user being sent to described setup of attribute unit, exports the code file that described engine unit generates,
Wherein, described setup of attribute unit comprises:
Name attribute module, for according to user's parameter, arranges the name variable rule in file name rule and file, generates corresponding expandable mark language XML configuration file output;
Page properties module, for receiving user's parameter, arranges the page shape, the control type on the page, control color and the control layout that are shown to user, generates corresponding CSS (cascading style sheet) CSS configuration file output;
Database module, for receiving user's parameter, arranges the list structure, field attribute, major key attribute, the index attributes that on the described page, show, generates corresponding XML configuration file output.
2. code generating unit according to claim 1, is characterized in that, described database module comprises:
Table name attribute submodule, for receiving user's parameter, arranges the naming rule of described table, generates corresponding XML configuration file output;
Field attribute submodule, for receiving user's parameter, arranges the interior data type of each field in table and shows rule, generates corresponding XML configuration file output;
Major key attribute submodule, for receiving user's parameter, arranges the create-rule of major key in table, generates corresponding XML configuration file output;
Index attributes submodule, for receiving user's parameter, arranges the index in table, generates corresponding XML configuration file output.
3. code generating unit according to claim 1, is characterized in that, described setup of attribute also comprises in unit:
Data basd link connection module, for XML configuration file stores that described database module is generated to database;
Described engine unit, for obtaining described XML configuration file by described database.
4. code generating unit according to claim 3, is characterized in that, described engine unit comprises:
Database component, for receiving user's parameter, arranges and connects described data base configuration file;
Resolve attribute assembly, for obtaining the XML configuration file of the XML configuration file of described database preservation, the generation of described name attribute module and the CSS configuration file of described page properties module generation and resolving;
Code formation component, for selecting corresponding code module according to the described file attribute parsing, and generating code file.
5. code generating unit according to claim 4, is characterized in that, described engine unit, also comprises:
Configuration file assembly, is configured to predefined file for the code file that code formation component is generated.
CN200910244278.2A 2009-12-30 2009-12-30 J2EE architecture-based code generating device Expired - Fee Related CN102117202B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910244278.2A CN102117202B (en) 2009-12-30 2009-12-30 J2EE architecture-based code generating device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910244278.2A CN102117202B (en) 2009-12-30 2009-12-30 J2EE architecture-based code generating device

Publications (2)

Publication Number Publication Date
CN102117202A CN102117202A (en) 2011-07-06
CN102117202B true CN102117202B (en) 2014-03-12

Family

ID=44215985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910244278.2A Expired - Fee Related CN102117202B (en) 2009-12-30 2009-12-30 J2EE architecture-based code generating device

Country Status (1)

Country Link
CN (1) CN102117202B (en)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102082682B (en) * 2009-11-26 2013-11-06 中兴通讯股份有限公司 Method and device for configuring performance statistic counter
CN103135976B (en) * 2011-11-30 2016-05-11 阿里巴巴集团控股有限公司 code automatic generation method and device
CN103176778B (en) * 2011-12-21 2017-04-05 北大方正集团有限公司 Web development methods and device
CN105022635A (en) * 2015-07-23 2015-11-04 北京中油瑞飞信息技术有限责任公司 Algorithm file generating method and apparatus based on cloud platform and cloud platform
CN104965714A (en) * 2015-07-27 2015-10-07 广州杰赛科技股份有限公司 Code generation method and system of application software
CN105373520A (en) * 2015-10-13 2016-03-02 金蝶软件(中国)有限公司 Method and device for setting control style attributes
CN106776487A (en) * 2015-11-23 2017-05-31 北大方正集团有限公司 Electronic publication trailing and device
CN105354036B (en) * 2015-11-26 2019-02-01 深圳市金证科技股份有限公司 Database manipulation code generating method and device
CN106095792A (en) * 2016-05-27 2016-11-09 中国银联股份有限公司 The method and apparatus generating database manipulation code
CN107797826B (en) * 2017-05-19 2020-03-17 平安科技(深圳)有限公司 Rule configuration method based on rule engine, terminal and equipment
CN108536429B (en) * 2018-03-28 2022-01-28 海尔优家智能科技(北京)有限公司 Method and device for developing software, storage medium and electronic equipment
CN109032662B (en) * 2018-06-19 2021-03-23 未鲲(上海)科技服务有限公司 Code file generation method and device, computer equipment and storage medium
CN112181398A (en) * 2019-06-13 2021-01-05 上海幻电信息科技有限公司 Configuration file processing device, method and storage medium
CN110659027A (en) * 2019-09-20 2020-01-07 京东方科技集团股份有限公司 Code generation method and device and electronic equipment
CN112068895B (en) * 2020-08-10 2023-12-19 深圳市鼎盛光电有限公司 Code configuration method, device, video playing equipment and storage medium
CN113312084B (en) * 2021-05-26 2023-03-28 合肥移瑞通信技术有限公司 AT framework code automatic generation method and device, electronic equipment and storage medium
CN113986230A (en) * 2021-10-29 2022-01-28 中国银行股份有限公司 Method and device for customizing configuration multi-field page

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470602A (en) * 2007-12-25 2009-07-01 新奥特(北京)视频技术有限公司 Software development method depending on relational database
CN101604241A (en) * 2009-07-10 2009-12-16 杭州电子科技大学 A kind of code generating method of embedded system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002116911A (en) * 2000-10-06 2002-04-19 Revenet:Kk Automatic generation device for object-oriented program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470602A (en) * 2007-12-25 2009-07-01 新奥特(北京)视频技术有限公司 Software development method depending on relational database
CN101604241A (en) * 2009-07-10 2009-12-16 杭州电子科技大学 A kind of code generating method of embedded system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JP特开2002-116911A 2002.04.19

Also Published As

Publication number Publication date
CN102117202A (en) 2011-07-06

Similar Documents

Publication Publication Date Title
CN102117202B (en) J2EE architecture-based code generating device
CN101727324B (en) Code generation method and device
CN102968306B (en) A kind of code automatic generation method based on data model driving and system
CN102722372B (en) Method and system for automatically generating codes through classification and configuration
CN106371825B (en) A kind of mobile terminal application interface list dynamic creation method and device
CN101308490B (en) Dynamic report generation method and platform
US20070130512A1 (en) Systems and methods for report design and generation
CN109933752A (en) A kind of method and apparatus exporting electronic document
CN110543303B (en) Visual service platform
CN103778107A (en) Method and platform for quickly and dynamically generating form based on EXCEL
CN111126019B (en) Report generation method and device based on mode customization and electronic equipment
US8756407B2 (en) Configuration rule prototyping tool
CN108762743A (en) Data table operation code generation method and device
CN104793961A (en) Quick JavaWeb development method and system using native Web codes
CN101446971A (en) Method for building content management system and device thereof
CN101714078A (en) Code generation method and device
CN115237380A (en) Low-code development system and method based on element codes
CN109614088B (en) Form component generation method and device
CN102521008B (en) Program compiling device and method for compiling program
CN113535177A (en) Form generation method, device and equipment
CN102023859B (en) Digital development environment-oriented software integration method with reliability, maintainability and supportability
US20050216501A1 (en) System and method of providing and utilizing an object schema to facilitate mapping between disparate domains
CN102830974A (en) Visual auxiliary development tool for rapid generation of JAVA codes
CN100414498C (en) SERVER edition code generation system capable of realizing code reutilizization
CN112596719A (en) Method and system for generating front-end and back-end codes

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220908

Address after: 3007, Hengqin international financial center building, No. 58, Huajin street, Hengqin new area, Zhuhai, Guangdong 519031

Patentee after: New founder holdings development Co.,Ltd.

Patentee after: Founder International Co.,Ltd. (Beijing)

Address before: 100871, Haidian District Fangzheng Road, Beijing, Zhongguancun Fangzheng building,, 5F

Patentee before: PEKING UNIVERSITY FOUNDER GROUP Co.,Ltd.

Patentee before: Founder International Co.,Ltd. (Beijing)

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140312