CN101419544A - Program code automatic generator of computer - Google Patents

Program code automatic generator of computer Download PDF

Info

Publication number
CN101419544A
CN101419544A CNA2007101340091A CN200710134009A CN101419544A CN 101419544 A CN101419544 A CN 101419544A CN A2007101340091 A CNA2007101340091 A CN A2007101340091A CN 200710134009 A CN200710134009 A CN 200710134009A CN 101419544 A CN101419544 A CN 101419544A
Authority
CN
China
Prior art keywords
code
database
program code
computer
function
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
CNA2007101340091A
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.)
Zhenjiang Yction Software Co Ltd
Original Assignee
Zhenjiang Yction Software 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 Zhenjiang Yction Software Co Ltd filed Critical Zhenjiang Yction Software Co Ltd
Priority to CNA2007101340091A priority Critical patent/CN101419544A/en
Publication of CN101419544A publication Critical patent/CN101419544A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The invention relates to an automatic generator of a computer program code. The generator automatically generates the computer program code according to specific grammar after a list structure of a target database is recognized. The generator is characterized in that the generated computer program code is based on C# grammar and is used for accessing, modifying and deleting the known data codes of SqlServer or Access database list, or generating a code of a storage process of the corresponding database according to the list structure of the database. The generator breaks through the conventional way that a programmer manually inputs code for computer software development, thus enhancing the software development speed and efficiency.

Description

A kind of program code automatic generator of computer
Technical field
The present invention relates to a kind of program code automatic generator of computer, especially a kind of based on the C# grammer, be used for visit, revise, delete data in known SqlServer or the Access database table, perhaps generate the program code automatic generator of computer of associated databases storing process according to the structure of showing in the database.
Background technology
Computer program code is to be used for making computer software and hardware driving, the most basic component units of instruments such as operating system.Each computer software, no matter be application software, hardware driving software, operating system software, the generation form that it is final, all is to write personnel on specific computer program developing instrument at present, forms by the computer program code of certain grammar rule handwriting input by computer program code.
Yet; continuous development and renewal along with computer technology; the scale of computer software is in continuous expansion; at present; the program code of larger computer software has had more than several hundred million row; and upgrade and development along with computer technology keeps, the scale of computer software is also continuing to increase.Thus, the pattern of present hand-coding computer program code has limited the paces that the computer software scale enlarges to a certain extent.
And in the computer application software based on database, for being used for visit, revise, in the table of deletion given data storehouse data computing machine program code not only size of code in whole destination software systems, occupied sizable scale, and this partial code is based on the code with certain regularity of database table structure, computer program code is write personnel when writing this part code, can use some instruments fully and generate this part code automatically.
Summary of the invention
The objective of the invention is to: at the deficiency of above prior art existence, in exploitation during based on the software systems of database, propose a kind of can be according to the list structure of database and the grammer C# of appointment, automatically generate and be used for visit, revise data computing machine program code in the table of deletion given data storehouse.
In order to reach above purpose, program code automatic generator of computer of the present invention should comprise following assembly:
The database structure recognizer component---in order to accessing database, identify table name and each field name shown in the database, the attribute of field, information such as span;
The code formation component---in order in internal memory, the information according to the database structure recognizer component identifies generates corresponding code according to the C# grammer;
The storing process formation component---in order in internal memory, the information according to the database structure recognizer component identifies generates corresponding storing process code according to the SQL grammer;
Object code maker---but an edit tool that is similar to notepad, the code after the generation are presented in this editing machine, and the user can edit the code after the generation.
Present computer software based on database, operation for each table in the data is specially: newly-increased record in table, call number according to record is revised a record, record of call number deletion according to record, call number according to record is obtained a record, obtains all records in the table.Program code automatic generator of computer of the present invention will generate the function of finishing aforesaid operations successively according to the C# grammer, and generates the storing process that each function need use according to the SQL grammer after will identifying list structure according to its database structure recognizer component.The result who generates is presented in the object code maker.
Concrete code generates and comprises following step:
Step 1: call third party's assembly ADO (ActiveX DataObjects) by the database structure recognizer component, method in this assembly can be obtained table name and the field name in the database, and the database server name is provided with in the database server dialog box input and obtains of the present invention by the user;
Step 2: the code formation component generates following several function successively according to table and table name and the database server name obtained:
Function 1 newly-increased record:
Function is by name: what AddRec, function specifically finished is operating as: open database and connect, obtain the value of newly-increased each field of record, the value of newly-increased each field of record is transmitted by function parameters, carry out the Add statement of SQL then, closing database connects afterwards, and function finishes.
Function 2 is revised a record according to the call number of record:
Function is by name: UpdateRec, what function was specifically finished is operating as: open database and connect, obtain the value of each field of record of modification, the value of each field of amendment record is transmitted by function parameters, carry out the Update statement of SQL then, closing database connects afterwards, and function finishes.
Function 3 is deleted a record according to the call number of record:
Function is by name: what DelRec, function specifically finished is operating as: open database and connect, carry out the Delete statement of SQL then, the call number of searching record is transmitted by function parameters, and closing database connects afterwards, and function finishes.
Function 4 obtains a record according to the call number of record:
Function is by name: what Sel0neRec, function specifically finished is operating as: open database and connect, carry out the Select statement of SQL then, the call number of searching record is transmitted by function parameters, closing database connects afterwards, returns the record of inquiry, and function finishes.
Function 5 obtains all records in the table:
Function is by name: what SelA11Rec, function specifically finished is operating as: open database and connect, carry out the Select statement of SQL then, closing database connects afterwards, and the record that need return spreads out of by array, and function finishes.
Select to need to generate storing process as the user, then the code formation component generates following several storing process successively according to table and table name and the database server name obtained:
The storing process of a newly-increased record is according to the ADD statement of table name and field name generation SQL;
Revise the storing process of a record, according to the Update statement of table name and field name generation SQL, this storing process need import call number into as parameter;
The storing process of a record of deletion, according to the Delete statement of table name and field name generation SQL, this storing process need import call number into as parameter;
Obtain the storing process of a record, according to the Select statement of table name and field name generation SQL, this storing process need import call number into as parameter.
All codes are stored in the internal memory after generating, and are written to then in the object code maker.The editing area of object code maker is exactly an interim notepad file in fact, the process that writes code generator is exactly by calling a file object, uses the binary stream object to write file.After code all was written in the object code maker, then completion code generated automatically.The user can revise the code that generates according to the special requirement of oneself in the object code maker, revising the back user that finishes can directly copy the code that generates in user's the developing instrument.
Embodiment
Embodiment one
Present embodiment comprises the steps:
Step 1: after the user installs the present invention on computers, open execute file, open then the database server dialog box is set, in this dialog box, need to select the target database of generating code, the user cipher of input database server is clicked and is determined to connect database;
Step 2: behind the database, the user need to select the database table of generating code in the connection;
Step 3: choose after the database table, the present invention will be according to the automatic generation computer program code of being provided with of user, and the code steps of generator program is as described below:
1: call third party's assembly ADO (ActiveX Data Objects) by the database structure recognizer component, method in this assembly can be obtained table name and the field name in the database, and the database server name is provided with in the database server dialog box input and obtains of the present invention by the user;
2: the code formation component generates following several function successively according to table and table name and the database server name obtained:
Function 1 newly-increased record:
Function is by name: what AddRec, function specifically finished is operating as: open database and connect, obtain the value of newly-increased each field of record, the value of newly-increased each field of record is transmitted by function parameters, carry out the Add statement of SQL then, closing database connects afterwards, and function finishes.
Function 2 is revised a record according to the call number of record:
Function is by name: UpdateRec, what function was specifically finished is operating as: open database and connect, obtain the value of each field of record of modification, the value of each field of amendment record is transmitted by function parameters, carry out the Update statement of SQL then, closing database connects afterwards, and function finishes.
Function 3 is deleted a record according to the call number of record:
Function is by name: what DelRec, function specifically finished is operating as: open database and connect, carry out the Delete statement of SQL then, the call number of searching record is transmitted by function parameters, and closing database connects afterwards, and function finishes.
Function 4 obtains a record according to the call number of record:
Function is by name: what Se10neRec, function specifically finished is operating as: open database and connect, carry out the Select statement of SQL then, the call number of searching record is transmitted by function parameters, closing database connects afterwards, returns the record of inquiry, and function finishes.
Function 5 obtains all records in the table:
Function is by name: what SelA11Rec, function specifically finished is operating as: open database and connect, carry out the Select statement of SQL then, closing database connects afterwards, and the record that need return spreads out of by array, and function finishes.
Select to need to generate storing process as the user, then the code formation component generates following several storing process successively according to table and table name and the database server name obtained:
The storing process of a newly-increased record is according to the ADD statement of table name and field name generation SQL;
Revise the storing process of a record, according to the Update statement of table name and field name generation SQL, this storing process need import call number into as parameter;
The storing process of a record of deletion, according to the Delete statement of table name and field name generation SQL, this storing process need import call number into as parameter;
Obtain the storing process of a record, according to the Select statement of table name and field name generation SQL, this storing process need import call number into as parameter.
All codes are stored in the internal memory after generating, and are written to then in the object code maker.The editing area of object code maker is exactly an interim notepad file in fact, the process that writes code generator is exactly by calling a file object, uses the binary stream object to write file.After code all was written in the object code maker, then completion code generated automatically.The user can revise the code that generates according to the special requirement of oneself in the object code maker, revising the back user that finishes can directly copy the code that generates in user's the developing instrument.

Claims (3)

1. program code automatic generator of computer, can generate computer program code automatically, it is characterized in that, the computer program code that generates is based on the C# grammer, can be used for visit, revise, delete the code of data in known SqlServer or the Access database table, perhaps generate the code of associated databases storing process according to the structure of showing in the database.
2. according to the described a kind of program code automatic generator of computer of claim 1, it is characterized in that comprising following assembly:
The database structure recognizer component---in order to accessing database, identify table name and each field name shown in the database, the attribute of field, information such as span;
The code formation component---in order in internal memory, the information according to the database structure recognizer component identifies generates corresponding code according to the C# grammer;
The storing process formation component---in order in internal memory, the information according to the database structure recognizer component identifies generates corresponding storing process code according to the SQL grammer;
Object code maker---but an edit tool that is similar to notepad, the code after the generation are presented in this editing machine, and the user can edit the code after the generation.
3. according to the described program code automatic generator of computer of claim 2, it is characterized in that: the computer program code after the generation can also be edited by the user.
CNA2007101340091A 2007-10-26 2007-10-26 Program code automatic generator of computer Pending CN101419544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007101340091A CN101419544A (en) 2007-10-26 2007-10-26 Program code automatic generator of computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007101340091A CN101419544A (en) 2007-10-26 2007-10-26 Program code automatic generator of computer

Publications (1)

Publication Number Publication Date
CN101419544A true CN101419544A (en) 2009-04-29

Family

ID=40630339

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007101340091A Pending CN101419544A (en) 2007-10-26 2007-10-26 Program code automatic generator of computer

Country Status (1)

Country Link
CN (1) CN101419544A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101819530A (en) * 2010-04-30 2010-09-01 山东中创软件工程股份有限公司 Program object generation method and device and computer
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
CN103455316A (en) * 2012-07-27 2013-12-18 安徽工业大学 Class-based code generator
CN103713887A (en) * 2012-09-29 2014-04-09 镇江金软计算机科技有限责任公司 Program code generator
CN106126224A (en) * 2016-06-21 2016-11-16 浪潮软件集团有限公司 Tool, system and method for generating program object

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101819530A (en) * 2010-04-30 2010-09-01 山东中创软件工程股份有限公司 Program object generation method and device and computer
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
CN103135976B (en) * 2011-11-30 2016-05-11 阿里巴巴集团控股有限公司 code automatic generation method and device
CN103455316A (en) * 2012-07-27 2013-12-18 安徽工业大学 Class-based code generator
CN103713887A (en) * 2012-09-29 2014-04-09 镇江金软计算机科技有限责任公司 Program code generator
CN106126224A (en) * 2016-06-21 2016-11-16 浪潮软件集团有限公司 Tool, system and method for generating program object

Similar Documents

Publication Publication Date Title
CN107918666B (en) Data synchronization method and system on block chain
CN1153142C (en) Transaction file system for updating elements in a plenty of files through transactions
CN101582079B (en) Object query method and device
CN101887365B (en) Method and system for constructing executable code for component-based applications
CN102426582B (en) Data manipulation management devices and data manipulation management method
CN110209650A (en) The regular moving method of data, device, computer equipment and storage medium
US8881127B2 (en) Systems and methods to automatically generate classes from API source code
JPH04289920A (en) Method and device for controlling data object version affected by engineering change
CN101419544A (en) Program code automatic generator of computer
CN103440285B (en) Large-scale mobile phone games system and database update method thereof
CN103577329A (en) Snapshot management method and device
US9535687B2 (en) Audited builds based upon separate class dependency records
CN103107919A (en) Method and system for network resource modeling
CN100527131C (en) Interdynamic access method and tool of IMS data base
CN110727777A (en) Knowledge graph management method and device, computer equipment and storage medium
US20120185451A1 (en) Data processing method and system for database management system
CN108427572B (en) Land survey database updating method and updating increment package generating method thereof
CN103713887A (en) Program code generator
CN111752549A (en) SQL function generation method and device
JP4136594B2 (en) Data processing method and data processing program
KR100985192B1 (en) System for developing software
US20050226597A1 (en) Processing systems and methods of controlling same
CN103365909A (en) Method for sequentially generating accumulated values one by one in data table
CN109634606A (en) A kind of method and device of defined function menu
CN103778112A (en) Form data batch storage achieving method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20090429