CN104598233A - Code generation method - Google Patents

Code generation method Download PDF

Info

Publication number
CN104598233A
CN104598233A CN201510015190.9A CN201510015190A CN104598233A CN 104598233 A CN104598233 A CN 104598233A CN 201510015190 A CN201510015190 A CN 201510015190A CN 104598233 A CN104598233 A CN 104598233A
Authority
CN
China
Prior art keywords
code
user
database
data
generating
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.)
Pending
Application number
CN201510015190.9A
Other languages
Chinese (zh)
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.)
BEIJING SINOIOV VEHICLE NETWORK TECHNOLOGY Co Ltd
Original Assignee
BEIJING SINOIOV VEHICLE NETWORK TECHNOLOGY 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 BEIJING SINOIOV VEHICLE NETWORK TECHNOLOGY Co Ltd filed Critical BEIJING SINOIOV VEHICLE NETWORK TECHNOLOGY Co Ltd
Priority to CN201510015190.9A priority Critical patent/CN104598233A/en
Publication of CN104598233A publication Critical patent/CN104598233A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a code generation method. A developer can connect a configuration interface with a simple graphic database, and three layers of architecture codes based on an MVC (model view controller) can be dynamically generated, so that the effects of reducing the workload of the developer for developing the codes and quickly responding the development demand of the developer are achieved. By the use of a Create Date Code generator, the method comprises the steps of (1) acquiring a database and generating relevant configuration information of the codes; (2) dynamically generating the codes; (3) informing a user of copying a generated code file to a project directory.

Description

A kind of code generating method
Technical field
The present invention relates to the technical field of computing machine, relate to a kind of code generating method particularly.
Background technology
Along with the development and progress of human society, computer technology is fast development also.At present, there are some code generating methods, be used for software code.
But there are following shortcomings and deficiencies in existing most of code generating method:
1. only consider the situation of a certain certain database in the design phase, only support single database, compatible multitype database cannot be expanded;
2. realizing the generating code stage, only consider by the generation of single tables of data simple based on MVC (Model View Controller, Model View Controller) three-tier architecture code, only support that simple additions and deletions change and look into operation, do not support self-defined sql statement (a kind of language to database operates) and storing process, to be inapplicablely applied in complicated service logic scene.
Summary of the invention
Technology of the present invention is dealt with problems and is: overcome the deficiencies in the prior art, a kind of code generating method is provided, it makes developer pass through simple patterned DataBase combining configuration interface, dynamic generation based on the three-tier architecture code of MVC, thus reaches the effect of code operation amount, fast the response development requirement simplifying developer's exploitation.
Technical solution of the present invention is: this code generating method, and the method uses Create DataCode code generator, and comprises the following steps:
(1) database and generating code relevant configuration information is obtained;
(2) dynamic generating code;
(3) notify that the code file of generation is copied to project directory by user.
Or, this code generating method, the method uses CreateDataCode code generator, and comprises the following steps:.
(I) start;
(II) graphical interface of user is loaded;
(III) type of database of user's input, link address, password, account and code building catalogue is obtained;
(IV) order that user clicks connection data storehouse is received;
(V) judge whether energy exact connect ion database, be perform step (VI), otherwise perform step (XIV);
(VI) system display Database Lists;
(VII) user's double-click data library name is notified;
(VIII) all tables of data lists in system display correspondence database;
(IX) notify that user chooses multiple tables of data, click generating code button;
(X) relation for the row correspondence in database, tables of data, tables of data utilizes the dynamic generating code file of method for reflection, Code Template;
(XI) judge whether it successfully, is perform step (XII), otherwise perform step (XIV);
(XII) under the code of generation being saved to the file path of user preset;
(XIII) notify that the code file of generation is copied to project directory by user;
(XIV) terminate.
The present invention is by using Create Data Code code generator, obtain database and generating code relevant configuration information, dynamic generating code, developer is made to pass through simple patterned DataBase combining configuration interface, dynamic generation based on the three-tier architecture code of MVC, thus reaches the effect of code operation amount, fast the response development requirement simplifying developer's exploitation.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of a preferred embodiment according to code generating method of the present invention.
Embodiment
This code generating method, the method uses Create Data Code code generator, and comprises the following steps:
(1) database and generating code relevant configuration information is obtained;
(2) dynamic generating code;
(3) notify that the code file of generation is copied to project directory by user.
The present invention is by using Create Data Code code generator, obtain database and generating code relevant configuration information, dynamic generating code, developer is made to pass through simple patterned DataBase combining configuration interface, dynamic generation based on the three-tier architecture code of MVC, thus reaches the effect of code operation amount, fast the response development requirement simplifying developer's exploitation.
In addition, described step (1) comprises step by step following:
(1.1) graphical interface of user is loaded;
(1.2) type of database of user's input, link address, password, account and code building catalogue is obtained;
(1.3) order that user clicks connection data storehouse is received;
(1.4) system display Database Lists and data table information corresponding to Database Lists;
(1.5) notify that user chooses multiple tables of data, click generating code button.
In addition, described step (2) comprises step by step following:
(2.1) relation for the row correspondence in database, tables of data, tables of data utilizes the dynamic generating code file of method for reflection, Code Template;
(2.2) under the code of generation being saved to the file path of user preset.
As shown in Figure 1, this code generating method, the method uses CreateDataCode code generator, and comprises the following steps:.
(I) start;
(II) graphical interface of user is loaded;
(III) type of database of user's input, link address, password, account and code building catalogue is obtained;
(IV) order that user clicks connection data storehouse is received;
(V) judge whether energy exact connect ion database, be perform step (VI), otherwise perform step (XIV);
(VI) system display Database Lists;
(VII) user's double-click data library name is notified;
(VIII) all tables of data lists in system display correspondence database;
(IX) notify that user chooses multiple tables of data, click generating code button;
(X) relation for the row correspondence in database, tables of data, tables of data utilizes the dynamic generating code file of method for reflection, Code Template;
(XI) judge whether it successfully, is perform step (XII), otherwise perform step (XIV);
(XII) under the code of generation being saved to the file path of user preset;
(XIII) notify that the code file of generation is copied to project directory by user;
(XIV) terminate.
Beneficial effect of the present invention is as follows:
1. easy to operate, by simple graphical interfaces, configuration-related data storehouse parameter, supports self-defined file directory and the NameSpace of selecting generation;
2. support to select arbitrarily database server, database and tables of data;
3. the code generated not only comprises based on OO MVC three-tier architecture, and also dynamic generates the front end html page;
4. extendability is strong, and Code Design adopts the multiple Design Mode such as abstract factory, order, and easily extensible supports multitype database;
5. support self-defined sql statement and storing process;
6. be easy to the engineering being integrated into any MVC framework, direct copying is to respective directories.
Provide concrete application scenarios below:
Developer, in any one software systems process of exploitation, whenever needing the basic data in system to safeguard, realizing additions and deletions and changing when looking into operation associated with other, the technology provided in this patent can be used to complete the development of basic data fast.
The above; it is only preferred embodiment of the present invention; not any pro forma restriction is done to the present invention, every above embodiment is done according to technical spirit of the present invention any simple modification, equivalent variations and modification, all still belong to the protection domain of technical solution of the present invention.

Claims (4)

1. a code generating method, is characterized in that: the method uses Create Data Code code generator, and comprises the following steps:
(1) database and generating code relevant configuration information is obtained;
(2) dynamic generating code;
(3) notify that the code file of generation is copied to project directory by user.
2. code generating method according to claim 1, is characterized in that: described step (1) comprises step by step following:
(1.1) graphical interface of user is loaded;
(1.2) type of database of user's input, link address, password, account and code building catalogue is obtained;
(1.3) order that user clicks connection data storehouse is received;
(1.4) system display Database Lists and data table information corresponding to Database Lists;
(1.5) notify that user chooses multiple tables of data, click generating code button.
3. code generating method according to claim 2, is characterized in that: described step (2) comprises step by step following:
(2.1) relation for the row correspondence in database, tables of data, tables of data utilizes the dynamic generating code file of method for reflection, Code Template;
(2.2) under the code of generation being saved to the file path of user preset.
4. a code generating method, is characterized in that: the method uses CreateDataCode code generator, and comprises the following steps:.
(I) start;
(II) graphical interface of user is loaded;
(III) type of database of user's input, link address, password, account and code building catalogue is obtained;
(IV) order that user clicks connection data storehouse is received;
(V) judge whether energy exact connect ion database, be perform step (VI), otherwise perform step (XIV);
(VI) system display Database Lists;
(VII) user's double-click data library name is notified;
(VIII) all tables of data lists in system display correspondence database;
(IX) notify that user chooses multiple tables of data, click generating code button;
(X) relation for the row correspondence in database, tables of data, tables of data utilizes the dynamic generating code file of method for reflection, Code Template;
(XI) judge whether it successfully, is perform step (XII), otherwise perform step (XIV);
(XII) under the code of generation being saved to the file path of user preset;
(XIII) notify that the code file of generation is copied to project directory by user;
(XIV) terminate.
CN201510015190.9A 2015-01-12 2015-01-12 Code generation method Pending CN104598233A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510015190.9A CN104598233A (en) 2015-01-12 2015-01-12 Code generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510015190.9A CN104598233A (en) 2015-01-12 2015-01-12 Code generation method

Publications (1)

Publication Number Publication Date
CN104598233A true CN104598233A (en) 2015-05-06

Family

ID=53124053

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510015190.9A Pending CN104598233A (en) 2015-01-12 2015-01-12 Code generation method

Country Status (1)

Country Link
CN (1) CN104598233A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899045A (en) * 2015-06-23 2015-09-09 上海斐讯数据通信技术有限公司 Universal software coding assistance system and method
CN106598620A (en) * 2016-12-21 2017-04-26 深圳南北互联网金融服务有限公司 Code generation method and code generator
CN106886390A (en) * 2015-12-15 2017-06-23 大唐软件技术股份有限公司 A kind of Java object generation and conversion method and Java object generation and conversion equipment
CN107273116A (en) * 2017-05-22 2017-10-20 互联天下科技发展(深圳)有限公司 The method that code is produced using the Code Generator based on framework
CN107357588A (en) * 2017-07-19 2017-11-17 万帮充电设备有限公司 Object Code Generator method and device
CN108984245A (en) * 2018-06-20 2018-12-11 武汉斑马快跑科技有限公司 A kind of page switching method and system based on single view controller
CN109725893A (en) * 2018-05-17 2019-05-07 平安普惠企业管理有限公司 Code generating method, unit and computer readable storage medium
CN112463145A (en) * 2020-12-04 2021-03-09 上海路人王信息科技有限公司 Code generation method, terminal device and computer-readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030103080A1 (en) * 2001-12-05 2003-06-05 Bahman Radjabi System and method for developing a code generator for object-oriented communication protocol
CN101697120A (en) * 2009-11-05 2010-04-21 河南辉煌科技股份有限公司 Relational database based generation method of J2EE code
CN102122247A (en) * 2011-03-17 2011-07-13 深圳市同洲软件有限公司 Automatic code generating system and method
CN103135976A (en) * 2011-11-30 2013-06-05 阿里巴巴集团控股有限公司 Code automatic generation method and device
CN103412749A (en) * 2013-07-29 2013-11-27 福建联迪商用设备有限公司 Relational database based code generation method and code generator

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030103080A1 (en) * 2001-12-05 2003-06-05 Bahman Radjabi System and method for developing a code generator for object-oriented communication protocol
CN101697120A (en) * 2009-11-05 2010-04-21 河南辉煌科技股份有限公司 Relational database based generation method of J2EE code
CN102122247A (en) * 2011-03-17 2011-07-13 深圳市同洲软件有限公司 Automatic code generating system and method
CN103135976A (en) * 2011-11-30 2013-06-05 阿里巴巴集团控股有限公司 Code automatic generation method and device
CN103412749A (en) * 2013-07-29 2013-11-27 福建联迪商用设备有限公司 Relational database based code generation method and code generator

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘于新 等: "基于模板的.Net三层架构的代码自动生成", 《计算机技术与发展》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899045A (en) * 2015-06-23 2015-09-09 上海斐讯数据通信技术有限公司 Universal software coding assistance system and method
CN104899045B (en) * 2015-06-23 2019-07-16 上海斐讯数据通信技术有限公司 A kind of general Software Coding auxiliary system and method
CN106886390A (en) * 2015-12-15 2017-06-23 大唐软件技术股份有限公司 A kind of Java object generation and conversion method and Java object generation and conversion equipment
CN106598620A (en) * 2016-12-21 2017-04-26 深圳南北互联网金融服务有限公司 Code generation method and code generator
CN107273116A (en) * 2017-05-22 2017-10-20 互联天下科技发展(深圳)有限公司 The method that code is produced using the Code Generator based on framework
CN107273116B (en) * 2017-05-22 2020-09-25 互联天下科技发展(深圳)有限公司 Method for producing code using framework-based code generation tool
CN107357588A (en) * 2017-07-19 2017-11-17 万帮充电设备有限公司 Object Code Generator method and device
CN107357588B (en) * 2017-07-19 2020-08-14 万帮充电设备有限公司 Object code generation method and device
CN109725893A (en) * 2018-05-17 2019-05-07 平安普惠企业管理有限公司 Code generating method, unit and computer readable storage medium
CN108984245A (en) * 2018-06-20 2018-12-11 武汉斑马快跑科技有限公司 A kind of page switching method and system based on single view controller
CN112463145A (en) * 2020-12-04 2021-03-09 上海路人王信息科技有限公司 Code generation method, terminal device and computer-readable storage medium

Similar Documents

Publication Publication Date Title
CN104598233A (en) Code generation method
CN102591654B (en) A kind of code generator based on SSH framework and method
CN104424338A (en) Automatic generation device and automatic generation method for web system
CN105302545A (en) Method and device for custom control development of configuration software
CN103383645A (en) Code generation method and system
CN106951254B (en) Method and device for multiplexing similar service function modules in payment system
CN104391717A (en) Method for dynamically updating code during debugging
CN108829653A (en) A kind of generation method of report, device, equipment and medium
CN103207783A (en) Software development engine system based on browser/server mode and building method thereof
CN101604286B (en) Method for generating keyword-driving table
CN110851123A (en) WebGIS power grid visualization framework construction method, system and device based on SpringMVC
CN104809534A (en) Business process management system
CN103677819A (en) Method and device for achieving code forward engineering based on OSGI
CN102662662A (en) Embedded graphics interface generation system and method
CN103699746B (en) CADDS5 piping three-dimensional design method based on data base and system
CN110825367B (en) Design method of form designer suitable for Loongson CPU environment
WO2016201813A1 (en) Dynamic layout method and system based on android
CN103793227A (en) Method for achieving WCF service
CN110989999A (en) Code generation method and device, electronic equipment and medium
CN116415321A (en) Cloud CAD processing system and construction method thereof
CN104199675A (en) System capable of quick system development based on database parameter utilization
CN104063232B (en) A kind of method of the system development utilizing based on database parameter
CN110389751B (en) Data interface mock method applied to knowledge graph
JP5644599B2 (en) Object-oriented model design support device
CN104899018A (en) Design method of business process application software

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150506

RJ01 Rejection of invention patent application after publication