CN104142824A - Code generator based on class library and realization method of code generator - Google Patents

Code generator based on class library and realization method of code generator Download PDF

Info

Publication number
CN104142824A
CN104142824A CN201410321887.4A CN201410321887A CN104142824A CN 104142824 A CN104142824 A CN 104142824A CN 201410321887 A CN201410321887 A CN 201410321887A CN 104142824 A CN104142824 A CN 104142824A
Authority
CN
China
Prior art keywords
code generator
interface module
user
subscriber interface
code
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
CN201410321887.4A
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 CLOUDS POWER EDUCATION&TECHNOLOGY Co Ltd
Original Assignee
BEIJING CLOUDS POWER EDUCATION&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 CLOUDS POWER EDUCATION&TECHNOLOGY Co Ltd filed Critical BEIJING CLOUDS POWER EDUCATION&TECHNOLOGY Co Ltd
Priority to CN201410321887.4A priority Critical patent/CN104142824A/en
Publication of CN104142824A publication Critical patent/CN104142824A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a code generator based on a class library and a realization method of the code generator. The code generator comprises a user interface module creating module, a user interface module and an expansion class library; the application of the code generator is embedded into a browser, the user interface module is used for receiving data information input by a user, data information received from the user interface module is generated into codes according to preset class library calling instructions, and in addition, the generated codes are displayed through the user interface module. The code generator can realize the cross-platform application only through the browser without relying on external databases or external classes, and the user can use the code generator without the need of being familiar to the database design technology and the knowledge in the database software aspect, so the use difficulty of the code generator is reduced, and the software development speed and the software development efficiency are improved.

Description

A kind of code generator and its implementation based on class libraries
Technical field
The present invention relates to filed of network information security, in particular a kind of code generator and its implementation based on class libraries.
Background technology
First, traditional Code Generator itself is exactly a software, must under specific software environment, could move, when needs are changed platform or change working environment, need to reinstall very inconvenient, can not embody the advantage of quick robotization, such as codesmith must rely on the .net environment of Microsoft.
Secondly, traditional code generates and must rely on external data, such as: must drive by dependency database model, therefore requirement must establish database table, then could resolution table data structure building code, and if code variations must first Update Table storehouse, very loaded down with trivial details.
Therefore, prior art awaits further improvement.
Summary of the invention
In view of above-mentioned weak point of the prior art, the object of the invention is to provides a kind of code generator and its implementation based on class libraries for user, to solve that Code Generator traditional in prior art must could move under specific platform and code generation need to rely on the shortcoming of external data, provide a kind of can be from the code generator in source.
In order to achieve the above object, the present invention has taked following technical scheme:
A code generator based on class libraries, wherein, comprising: interconnective user interface creation module, subscriber interface module and expansion class libraries;
Described user interface creation module, for opening after the instruction of described code generator when receiving user, is loaded into the application of described code generator in browser according to the class of expanding in class libraries described in default script insertion instruction calls;
Described subscriber interface module, for receiving the data message of user's input, and shows the code corresponding with described data message generating in described expansion class libraries; Described data message is field name, type and length;
Described expansion class libraries, for the data message generating code receiving from described subscriber interface module according to default class libraries call instruction handle.
The described code generator based on class libraries, wherein, described subscriber interface module also comprises list data structure display unit;
Described list data structure display unit, for receiving when described subscriber interface module after the data message of user's input, first predefined program generates list data structure by described data message and shows on subscriber interface module, and user confirms described list data structure information.
The described code generator based on class libraries, wherein, on described subscriber interface module, also comprise the list data structure action button and the generating code button that shine upon mutually with class, the data that described list data structure action button is used in his-and-hers watches data are deleted or are revised.
The described code generator based on class libraries, wherein, also comprises data memory module, for subscriber interface module being received to operational order and the configuration data thereof of described data message, stores local hard drive into.
The implementation method of described code generator, wherein, comprising:
When receiving user, open after the instruction of described code generator, according to the class of expanding in class libraries described in default script insertion instruction calls, the application of described code generator is loaded in browser;
By subscriber interface module, receive the data message of user's input; Described data message is field name, type and length
According to the class in default class libraries call instruction invoke extensions class libraries by described data message generating code;
By subscriber interface module, the code of generation is shown.
The implementation method of described code generator, wherein, when described subscriber interface module receives after the data message of user's input, first predefined program generates list data structure by described data message and shows on subscriber interface module.
The implementation method of described code generator, wherein, the information of the described list data structure showing in user to user interface module is confirmed; If list data structure information errors, is deleted or is revised by the list data structure action button his-and-hers watches data structure information of shining upon mutually with class, confirm errorless after, by the generating code button generating code of clicking and class is shone upon mutually.
The implementation method of described code generator, wherein, the operational order and the configuration data thereof that subscriber interface module are received to described data message store local hard drive into by data memory module.
Beneficial effect: a kind of code generator and its implementation based on class libraries provided by the invention, by code generator is embedded on browser, realize cross-platform use, and by the class in invoke extensions class libraries, carry out the generation of automatic code, do not rely on outside database or outside class generating code, thereby improved speed and the efficiency of software development.
Accompanying drawing explanation
Fig. 1 is the structure principle chart of a kind of code generator based on class libraries of the present invention.
Fig. 2 is subscriber interface module of the present invention at user's structural representation of input data information not.
Fig. 3 is the structural representation of subscriber interface module of the present invention after user input data information.
Fig. 4 is the implementation method flow chart of steps of a kind of code generator based on class libraries of the present invention.
Embodiment
The invention provides a kind of code generator and its implementation based on class libraries.For making object of the present invention, technical scheme and effect clearer, clear and definite, referring to accompanying drawing examples, the present invention is described in more detail.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
This kind of code generator based on class libraries providing, as shown in Figure 1, described code generator comprises: interconnective user interface creation module 10, subscriber interface module 20 and expansion class libraries 30;
Described user interface creation module 10, for opening after the instruction of described code generator when receiving user, is loaded into the application of described code generator in browser according to the class of expanding in class libraries described in default script insertion instruction calls;
After code generator is loaded in browser, user just can find " code the generates .html " application program under described code generator on the browser of opening, by opening this application program, open the function of code generator of the present invention, by the generation of described code generator code.
Concrete, when user opens described code, generate .html " after application program; user interface creation module is just inserted in instruction calls expansion class libraries and class that open described subscriber interface module and shine upon mutually according to default script; open the subscriber interface module of described code generator, be convenient to user input data information and the code of checking that input data information is corresponding.
Further, due to described code generator is embedded in browser, therefore expanded the running environment of browser, the subscriber interface module of code generator is to be drawn and form according to preset program by browser, therefore after being loaded into browser, expansion class libraries can automatically realize the monitoring to browser version, realize the automatic renewal of data between expansion class libraries and browser, make browser support complicated data double-way binding technology.
Described subscriber interface module 20, for receiving the data message of user's input, and shows the code corresponding with described data message generating in described expansion class libraries; Described data message is field name, type and length.
After the subscriber interface module of code generator is opened, the user interface that user demonstrates in browser by it is inputted the data message that it wants generating code, described data message is field name, type, length or other information that whether must input, when described subscriber interface module receives after described data message, described data message is shown automatically on interface, and when expansion class libraries changes into described data message after code, the code changing into is shown on interface.
Described expansion class libraries 30, for the data message generating code receiving from described subscriber interface module according to default class libraries call instruction handle.
At expansion class libraries, comprise a lot of classes, when subscriber interface module receives after the data message of user's input, class corresponding in default class libraries call instruction invoke extensions class libraries generates list data structure by described data message, and according to the data structure building code of the table generating.
More clear to the information of its input for ease of user, make code generator of the present invention have that better user experiences and code formation speed preferably, on described subscriber interface module, also comprise that list data structure display unit and described code generator also comprise data memory module;
Described list data structure display unit, for receiving when described subscriber interface module after the data message of user's input, first predefined program generates list data structure by described data message and shows on subscriber interface module, and user confirms described list data structure information.
On described subscriber interface module, also comprise the list data structure action button and the generating code button that shine upon mutually with class, the data that described list data structure action button is used in his-and-hers watches data are deleted or are revised.
Described data memory module, stores local hard drive into for subscriber interface module being received to operational order and the configuration data thereof of described data message.
Concrete, in concrete application, use a kind of self-defining file based on json, be used for storing various instructions and the configuration data of the data message that subscriber interface module receives.The described file based on json can be saved in local hard drive by browser extension running environment, if the data message that user need to send it modify time, can be by the file preserved be before carried out to fast restore, on the basis of data message, modify coming, avoid repeated work; This structure can also be avoided relying on outside database table and carry out generating code, reaches the object from source.
For described code generator is carried out to more detailed explanation, the schematic diagram in concrete when application of the described code generator shown in Fig. 2 and Fig. 3 of take is foundation, and it is further detailed.
Fig. 2 is the schematic diagram of code generator subscriber interface module of the present invention, after the application program of the described code generator loading in user's open any browser, this subscriber interface module shows with the form of browser, user is by described subscriber interface module input data information, as can be seen from Figure 2 on subscriber interface module, be provided with the input area of different pieces of information information, such as sequence number, field name, type and annotation, be also provided with field is modified and preserved and the button of generating code.User can select to input it and want the data message that obtains code to subscriber interface module, the generation of code.
Fig. 3 is user's schematic diagram that after input data information, subscriber interface module shows on subscriber interface module, as described in Figure, after user input data information, the predefined program first program in invoke extensions class libraries generates list data structure by described data message and shows on subscriber interface module, user can delete or revise the list data structure demonstrating, confirm errorless after, by clicking the generating code button generating code on subscriber interface module.
Preferably, the code that described in the present invention, code generator generates is based on Python, can be for access, revise, delete the code of data in known python model bank, and conventional html web page code and the js code of the corresponding web program of data structure building according to table, has improved speed and the efficiency of software development.
Can expect, the code that above-mentioned code generator generates also can be extended to other language by expansion interface.
From above disclosed content, can obtain, code generator of the present invention only can be realized and realize cross-platform use by a browser, and automatic code generating does not rely on any computer language.
On the basis of code generator of the present invention, the present invention also provides the implementation method of described code generator, and as shown in Figure 4, described implementation method comprises the following steps:
S1, when receiving user, open after the instruction of described code generator, according to default script, insert the class of expanding in class libraries described in instruction calls the application of described code generator is loaded in browser; Specifically as described in as described in user interface creation module function.
S2, by subscriber interface module, receive the data message of user input; Described data message is field name, type and length.
S3, according to the class in default class libraries call instruction invoke extensions class libraries by described data message generating code.
S4, by subscriber interface module, the code of generation is shown.
On the basis of the embodiment of above-mentioned implementation method, corresponding with described code generator, in described implementation method, can also comprise following methods step:
When described subscriber interface module receives after the data message of user's input, first predefined program generates list data structure by described data message and shows on subscriber interface module.
The information of the described list data structure showing in user to user interface module is confirmed; If there is mistake in the information of list data structure, by the list data structure action button his-and-hers watches data structure information of shining upon mutually with class, delete or revise, confirm errorless after, by the generating code button generating code of clicking and class is shone upon mutually.
Operational order and configuration data thereof that subscriber interface module receives described data message store local hard drive into by data memory module.
A kind of code generator and its implementation based on class libraries provided by the invention, described code generator comprises: user interface creation module, subscriber interface module and expansion class libraries; Subscriber interface module creation module is for being embedded into browser by the application of described code generator, the data message that described subscriber interface module is inputted for receiving user, and the code corresponding with described data message generating in described expansion class libraries shown; Described expansion class libraries, for the data message generating code receiving from described subscriber interface module according to default class libraries call instruction handle.Described code generator only just can be realized by browser can cross-platform, and it does not rely on outside database or outside class, user does not need the knowledge of acquaint with data storehouse designing technique and database software aspect just can use it, thereby having reduced outside the difficulty of code generator use, speed and the efficiency of software development have been improved.
Be understandable that, for those of ordinary skills, can be equal to replacement or change according to technical scheme of the present invention and inventive concept thereof, and all these changes or replacement all should belong to the protection domain of the appended claim of the present invention.

Claims (8)

1. the code generator based on class libraries, is characterized in that, comprising: interconnective user interface creation module, subscriber interface module and expansion class libraries;
Described user interface creation module, for opening after the instruction of described code generator when receiving user, is loaded into the application of described code generator in browser according to the class of expanding in class libraries described in default script insertion instruction calls;
Described subscriber interface module, for receiving the data message of user's input, and shows the code corresponding with described data message generating in described expansion class libraries; Described data message is field name, type and length;
Described expansion class libraries, for the data message generating code receiving from described subscriber interface module according to default class libraries call instruction handle.
2. the code generator based on class libraries according to claim 1, is characterized in that, described subscriber interface module also comprises list data structure display unit;
Described list data structure display unit, for receiving when described subscriber interface module after the data message of user's input, first predefined program generates list data structure by described data message and shows on subscriber interface module, and user confirms described list data structure information.
3. the code generator based on class libraries according to claim 2, it is characterized in that, on described subscriber interface module, also comprise the list data structure action button and the generating code button that shine upon mutually with class, the data that described list data structure action button is used in his-and-hers watches data are deleted or are revised.
4. the code generator based on class libraries according to claim 2, is characterized in that, also comprises data memory module, for subscriber interface module being received to operational order and the configuration data thereof of described data message, stores local hard drive into.
5. the implementation method of code generator as claimed in claim 1, is characterized in that, comprising:
When receiving user, open after the instruction of described code generator, according to the class of expanding in class libraries described in default script insertion instruction calls, the application of described code generator is loaded in browser;
By subscriber interface module, receive the data message of user's input; Described data message is field name, type and length
According to the class in default class libraries call instruction invoke extensions class libraries by described data message generating code;
By subscriber interface module, the code of generation is shown.
6. the implementation method of code generator according to claim 5, it is characterized in that, when described subscriber interface module receives after the data message of user's input, first predefined program generates list data structure by described data message and shows on subscriber interface module.
7. the implementation method of code generator according to claim 6, is characterized in that, the information of the described list data structure showing in user to user interface module is confirmed; If list data structure information errors, is deleted or is revised by the list data structure action button his-and-hers watches data structure information of shining upon mutually with class, confirm errorless after, by the generating code button generating code of clicking and class is shone upon mutually.
8. the implementation method of code generator according to claim 5, is characterized in that, the operational order and the configuration data thereof that subscriber interface module are received to described data message store local hard drive into by data memory module.
CN201410321887.4A 2014-07-08 2014-07-08 Code generator based on class library and realization method of code generator Pending CN104142824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410321887.4A CN104142824A (en) 2014-07-08 2014-07-08 Code generator based on class library and realization method of code generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410321887.4A CN104142824A (en) 2014-07-08 2014-07-08 Code generator based on class library and realization method of code generator

Publications (1)

Publication Number Publication Date
CN104142824A true CN104142824A (en) 2014-11-12

Family

ID=51852006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410321887.4A Pending CN104142824A (en) 2014-07-08 2014-07-08 Code generator based on class library and realization method of code generator

Country Status (1)

Country Link
CN (1) CN104142824A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677365A (en) * 2016-02-25 2016-06-15 北京千家悦网络科技有限公司 On-line software development method and system
CN106886390A (en) * 2015-12-15 2017-06-23 大唐软件技术股份有限公司 A kind of Java object generation and conversion method and Java object generation and conversion equipment
CN110795080A (en) * 2019-10-21 2020-02-14 山东舜知信息科技有限公司 Automatic code generation system based on database annotation and construction method
CN111343492A (en) * 2020-02-17 2020-06-26 海信电子科技(深圳)有限公司 Display method and display device of browser in different layers

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030061311A1 (en) * 2001-09-24 2003-03-27 George Lo Method for providing engineering tool services
CN103164250A (en) * 2013-03-13 2013-06-19 上海智变网络科技有限公司 Method of fast generating independent website of the same type or other types in a compiling mode
CN103617037A (en) * 2013-11-27 2014-03-05 张洁 Developing method for web development system and web development system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030061311A1 (en) * 2001-09-24 2003-03-27 George Lo Method for providing engineering tool services
CN103164250A (en) * 2013-03-13 2013-06-19 上海智变网络科技有限公司 Method of fast generating independent website of the same type or other types in a compiling mode
CN103617037A (en) * 2013-11-27 2014-03-05 张洁 Developing method for web development system and web development system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886390A (en) * 2015-12-15 2017-06-23 大唐软件技术股份有限公司 A kind of Java object generation and conversion method and Java object generation and conversion equipment
CN105677365A (en) * 2016-02-25 2016-06-15 北京千家悦网络科技有限公司 On-line software development method and system
CN105677365B (en) * 2016-02-25 2019-04-12 北京千家悦网络科技有限公司 A kind of online software development approach and system
CN110795080A (en) * 2019-10-21 2020-02-14 山东舜知信息科技有限公司 Automatic code generation system based on database annotation and construction method
CN111343492A (en) * 2020-02-17 2020-06-26 海信电子科技(深圳)有限公司 Display method and display device of browser in different layers
CN111343492B (en) * 2020-02-17 2022-02-22 海信电子科技(深圳)有限公司 Display method and display device of browser in different layers

Similar Documents

Publication Publication Date Title
Wasserman Software engineering issues for mobile application development
Charkaoui et al. Cross-platform mobile development approaches
Okediran et al. Mobile operating systems and application development platforms: A survey
CN108228287B (en) QT-based user interface control generation method and device
US20080209390A1 (en) Pluggable model elements
CN102693280A (en) Webpage browsing method, WebApp framework, method and device for executing JavaScript, and mobile terminal
US20120110444A1 (en) Help Document Animated Visualization
CN103927163A (en) Plugin frame processing device and plugin system
CN111708557B (en) Method, device and storage medium for updating configuration file
CN101957756A (en) System and method for rapidly generating intelligent mobile terminal program
CN104142824A (en) Code generator based on class library and realization method of code generator
CN102262684A (en) Method and device for generating webpage page of mobile terminal
CN103995696B (en) The program bag custom-built system and method for customizing of mobile terminal
CN104965914A (en) Page display method and apparatus
CN106257418A (en) For by using assistance application to evaluate the technology of application
US8732655B2 (en) Systems and methods for metamodel transformation
CN110781425B (en) Display method, device and equipment of mobile terminal H5 page and storage medium
JP2017199359A (en) System and method for developing mobile based applications using model driven development
CN112235132B (en) Method, device, medium and server for dynamically configuring service
KR102141749B1 (en) APP program execution method and device
US20120330859A1 (en) Interactive business process modeling and simulation
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
US20220027172A1 (en) Assigning computing resources to execution of evaluators for image animation
Le Goaer et al. Android executable modeling: Beyond android programming
Korchi et al. Classification of existing mobile cross-platform approaches

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20141112