CN112181385A - Server program framework development method and server development program framework - Google Patents
Server program framework development method and server development program framework Download PDFInfo
- Publication number
- CN112181385A CN112181385A CN201910600163.6A CN201910600163A CN112181385A CN 112181385 A CN112181385 A CN 112181385A CN 201910600163 A CN201910600163 A CN 201910600163A CN 112181385 A CN112181385 A CN 112181385A
- Authority
- CN
- China
- Prior art keywords
- server
- framework
- development
- basic
- component library
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a server program framework development method and a server development program framework, wherein the server program framework development method is developed on the basis of a django framework, and comprises the following steps: selecting a django frame for packaging to form a basic frame of a server development frame; inheriting the View class of the basic frame, expanding the View class to form a basic View component library, and packaging the basic View component library; packaging a parameter checking component library in the basic framework to form a basic server development framework; and packaging a preset cookie cutter engineering component library into a basic server development program framework to form a server development program framework. The server program framework development method and the server development program framework provided by the invention comprise the standard processes of parameter verification, service processing and output processing, thereby effectively improving the web development efficiency and lightening the burden of developers.
Description
Technical Field
The invention relates to the field of computer program development, in particular to a server program framework development method and a server development program framework.
Background
Django (an open-source web development framework written in python language) is a simple and fast development database-driven website. Django emphasizes code reuse, multiple components can conveniently serve the whole framework in a 'plug-in' mode, Django has a plurality of third-party plug-ins with strong functions, and even can conveniently develop own toolkits, so that Django has strong expandability. At present, Django is used as a background framework, has comprehensive functions and provides most basic interfaces in the web development process.
However, most of the existing Django background frameworks only provide corresponding basic interfaces to meet the requirements of background development, and the existing Django background frameworks lack standard processes of parameter verification, service processing and output processing, so that development teams are required to carry out one-by-one inspection when the existing Django background frameworks carry out comprehensive parameter verification, which causes the problems of low code development speed, high error rate, difficulty in inspection and the like, affects the efficiency of web development and the quality of codes, and causes the maintenance cost of the codes, especially for large-scale development projects, the standard processes lacking parameter verification, service processing and output processing to consume a large amount of communication cost of the development teams.
Therefore, it is an urgent problem to develop a program framework and a method with a standard flow of parameter verification, service processing and output processing.
Disclosure of Invention
The invention aims to provide a standard process server development program framework containing parameter verification, business processing and output processing and a server development method of the server development program framework, so that the web development efficiency is improved, and the burden of developers is reduced.
Therefore, according to a first aspect, an embodiment of the present invention discloses a server program framework development method, which is developed based on a django framework, and includes:
selecting a django frame for packaging to form a basic frame of a server development frame;
inheriting the View class of the basic frame, expanding the View class to form a basic View component library, and packaging the basic View component library;
packaging a parameter checking component library in the basic framework to form a basic server development framework;
and packaging a preset cookie cutter engineering component library into a basic server development program framework to form a server development program framework.
Optionally, the extending the View class specifically includes:
adding a check _ params standard function, wherein the check _ params standard function is used for parameter check standardization;
adding a process standard function, wherein the process standard function is used for service processing standardization;
an output standard function is added, wherein the output standard function is used for output processing normalization.
Optionally, the parameter verification tool specifically includes a hook function, a Param _ schema variable, and an output _ schema variable, where:
the hook function is used for calling the input parameters and the output parameters;
the Param _ schema variable is used for checking the input parameters;
and the output _ schema variable is used for checking the output parameter.
Optionally, the server program framework development method further includes:
and regularly updating the basic view component library, the parameter checking component library and the Cookiecuter engineering component library in the server development program framework.
Optionally, the server program framework development method further includes:
the server development program framework is maintained periodically.
According to a second aspect, an embodiment of the present invention provides a server developer framework, the server developer framework being developed based on a django framework, the server developer framework including:
the base frame encapsulation module is used for selecting the django frame to carry out encapsulation to form a base frame of the server development frame;
the basic View packaging module is used for inheriting the View class of the basic frame, expanding the View class to form a basic View component library and packaging the basic View component library;
a parameter checking and packaging module, which packages a parameter checking component library in the basic frame to form a basic server development frame;
and the cookie cutter engineering packaging module is used for packaging a preset cookie cutter engineering component library into the basic server development program framework to form a server development program framework.
Optionally, the base view encapsulation module includes a check _ params standard function unit, a process standard function unit, and an output standard function unit, where:
the check _ params standard function unit is used for adding a check _ params standard function, and the check _ params standard function is used for parameter verification standardization;
the process standard function unit is used for increasing a process standard function, and the process standard function is used for service processing standardization;
and the output standard function unit is used for adding an output standard function, and the output standard function is used for output processing standardization.
Optionally, the parameter verification packaging module includes a hook function unit, a Param _ schema variable unit, and an output _ schema variable unit, where:
the hook function unit is used for calling input parameters and output parameters;
the Param _ schema variable unit is used for checking the input parameters;
and the output _ schema variable unit is used for checking the output parameter.
Optionally, the server development program framework further includes:
and the regular updating module is used for regularly updating the basic view component library, the parameter checking component library and the Cookiecuter engineering component library in the server development program framework.
Optionally, the server development program framework further includes:
and the regular maintenance module is used for regularly maintaining the server development program framework.
The invention has the beneficial effects that:
according to the scheme, the invention discloses a server program framework development method and a server program framework, wherein the server program framework development method inherits the View class of the django framework to expand the View class to form a basic View component library, and encapsulates the basic View component library, the parameter check component library and the Cookie engineering component library on the basis of the django framework.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart illustrating an implementation of a method for developing a server program framework according to an embodiment of the present invention;
FIG. 2 is a block diagram of a framework of a server development process according to an embodiment of the present invention;
FIG. 3 is a block diagram of a basic view encapsulation module according to an embodiment of the present invention;
FIG. 4 is a block diagram of a parametric inspection package module according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a standard process server development program framework containing parameter verification, business processing and output processing and a server development method of the server development program framework, so that the web development efficiency is improved, and the burden of developers is reduced. Therefore, the embodiment of the invention discloses a server program framework development method, which is developed on the basis of a django framework and comprises the following steps: selecting a django frame for packaging to form a basic frame of a server development frame; inheriting the View class of the basic frame, expanding the View class to form a basic View component library, and packaging the basic View component library; packaging a parameter checking component library in the basic framework to form a basic server development framework; and packaging a preset cookie cutter engineering component library into a basic server development program framework to form a server development program framework. The server program framework development method and the server development program framework provided by the invention comprise the standard processes of parameter verification, service processing and output processing, thereby effectively improving the web development efficiency and lightening the burden of developers. The technical solution of the present invention is described in detail below.
Example one
Referring to fig. 1, it is a flowchart of an implementation of a server program framework development method disclosed in this embodiment, where the server program framework development method is developed based on a django framework, and the server program framework development method includes:
s1, selecting a django frame for packaging to form a basic frame of the server development frame;
django is a framework based on the MVC construct. In Django, the part of the controller that accepts user input is handled by the framework itself, and the main purpose of Django is to develop database-driven websites easily and quickly. Django emphasizes code reuse, multiple components can conveniently serve the whole framework in a 'plug-in' mode, Django has a plurality of powerful third-party plug-ins, and Django can even conveniently develop a tool kit belonging to developers. In the embodiment of the invention, a django framework is adopted as a basic framework of the server program development framework.
S2, inheriting the View class of the basic frame, expanding the View class to form a basic View component library, and packaging the basic View component library;
the View class is the base View of django, and all components can be said to be derived directly or indirectly from View. In the embodiment of the invention, a View class is expanded to form a basic View component library, and a check _ params standard function is added in the process of expanding the View class and is used for parameter check standardization; a process standard function is added, and the process standard function is used for service processing standardization; an output standard function is added, which is used for output processing normalization.
S3, packaging a parameter checking component library in the basic framework to form a basic server development framework;
in the embodiment of the present invention, the parameter checking tool specifically includes a hook function, a Param _ schema variable, and an output _ schema variable, where the hook function is used to call an input parameter and an output parameter; the Param _ schema variable is used for checking the input parameters; and the output _ schema variable is used for verifying the output parameters, and calling and verifying the input parameters and the output parameters can be realized through the hook function, the Param _ schema variable and the output _ schema variable, so that the error rate of the development process is reduced, and the burden of developers is reduced. It should be noted that the Param _ schema variable and the output _ schema variable are variables of the json schema syntax check framework, and the Param _ schema variable and the output _ schema variable can check parameter types, character lengths, value ranges, regular matching, parameter dependencies, nested arrays, json, and the like.
In the embodiment of the present invention, the hook function may be an on _ request function and an on _ response function, where the on _ request function is set before processing a data request and used to call an input parameter; the on _ response function is set to call the output parameter after the data processing is completed.
And S4, packaging the preset cookie cutter engineering component library into the basic server development program framework to form the server development program framework.
The cookie cutter is a project generator, which can also be called as an engine, and the most core function of the cookie cutter is project generation. When the cookie cutter generates a project, the project template can be freely customized, so that the cookie cutter can generate the project template in any language, and the application is strong. In the embodiment of the invention, the Cookiecuter project component library is encapsulated on the basis of the django framework, so that the function of quickly generating the project template can be realized, the repeated work of developers is effectively reduced, and the web development efficiency is improved.
As a preferred embodiment, the method for developing a server program framework provided by the present invention further includes:
and regularly updating the basic view component library, the parameter checking component library and the Cookiecuter engineering component library in the server development program framework.
As a preferred embodiment, the method for developing a server program framework provided by the present invention further includes:
the server development program framework is maintained periodically.
In summary, the invention discloses a server program framework development method and a server program framework, wherein the server program framework development method extends a View class by inheriting the View class of a django framework to form a basic View component library, and encapsulates the basic View component library, a parameter check component library and a cookie engineering component library on the basis of the django framework.
Although the embodiments of the present invention have been described in detail, the embodiments of the present invention are not limited to the details of the above embodiments, and various simple modifications may be made to the technical solutions of the embodiments of the present invention within the technical idea of the embodiments of the present invention, and these simple modifications all fall within the protection scope of the embodiments of the present invention.
Example two
Referring to fig. 2, a block diagram of a server development framework disclosed in this embodiment is a server development framework, where the server development framework is developed based on a django framework, and the server development framework includes:
the basic framework encapsulation module 1 is used for selecting a django framework for encapsulation to form a basic framework of a server development framework;
the basic View packaging module 2 is used for inheriting the View class of the basic frame, expanding the View class to form a basic View component library and packaging the basic View component library;
the parameter inspection packaging module 3 packages a parameter inspection component library in the basic frame to form a basic server development frame;
and the cookie cutter engineering packaging module 4 is used for packaging a preset cookie cutter engineering component library into the basic server development program framework to form a server development program framework.
Referring to fig. 3 as a preferred implementation, fig. 3 is a block diagram of a basic view encapsulation module according to an embodiment of the present invention, where the basic view encapsulation module 2 includes a check _ params standard function unit 201, a process standard function unit 202, and an output standard function unit 203, where:
a check _ params standard function unit 201, configured to add a check _ params standard function, where the check _ params standard function is used for parameter verification standardization;
a process standard function unit 202, configured to add a process standard function, where the process standard function is used for service processing standardization;
and an output standard function unit 203, configured to add an output standard function, where the output standard function is used for output processing normalization.
Referring to fig. 4 as a preferred implementation, referring to fig. 4, fig. 4 is a block diagram of a parameter verification packaging module according to an embodiment of the present invention, where the parameter verification packaging module 3 includes a hook function unit 301, a Param _ schema variable unit 302, and an output _ schema variable unit 303, where:
a hook function unit 301, configured to call an input parameter and an output parameter;
a Param _ schema variable unit 302, configured to check an input parameter;
an output _ schema variable unit 303, configured to check the output parameter.
As a preferred embodiment, the server development program framework provided by the present invention further comprises:
and the regular updating module 5 is used for regularly updating the basic view component library, the parameter checking component library and the Cookiecuter engineering component library in the server development program framework.
As a preferred embodiment, the server development program framework provided by the present invention further comprises:
and the regular maintenance module 6 is used for regularly maintaining the server development program framework.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The server development program framework disclosed by the embodiment corresponds to the server development program framework disclosed by the embodiment, so that the description is relatively simple, and the relevant points can be referred to the description of the method part.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
In summary, the invention discloses a server program framework development method and a server program framework, wherein the server program framework development method extends a View class by inheriting the View class of a django framework to form a basic View component library, and encapsulates the basic View component library, a parameter check component library and a cookie engineering component library on the basis of the django framework.
The server program framework development method and the server program framework provided by the invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.
Claims (10)
1. A server program framework development method is characterized in that the server program framework development method is developed on the basis of a django framework, and the server program framework development method comprises the following steps:
selecting a django frame for packaging to form a basic frame of a server development frame;
inheriting the View class of the basic frame, expanding the View class to form a basic View component library, and packaging the basic View component library;
packaging a parameter checking component library in the basic framework to form a basic server development framework;
and packaging a preset cookie cutter engineering component library into the basic server development program framework to form a server development program framework.
2. The method for developing a server program framework according to claim 1, wherein the extending the View class specifically comprises:
adding a check _ params standard function, wherein the check _ params standard function is used for parameter check standardization;
adding a process standard function, wherein the process standard function is used for service processing standardization;
adding an output standard function, wherein the output standard function is used for output processing standardization.
3. The method for developing a server program framework according to claim 1, wherein the parameter checking tool specifically includes a hook function, a Param _ schema variable, and an output _ schema variable, wherein:
the hook function is used for calling input parameters and output parameters;
the Param _ schema variable is used for checking the input parameter;
and the output _ schema variable is used for verifying the output parameter.
4. The method for server program framework development according to claim 1, further comprising:
and periodically updating the basic view component library, the parameter checking component library and the Cookiecuter engineering component library in the server development program framework.
5. The method for server program framework development according to claim 1, further comprising:
and maintaining the server development program framework regularly.
6. A server developer framework, wherein the server developer framework is developed based on a django framework, and wherein the server developer framework comprises:
the base frame encapsulation module is used for selecting the django frame to carry out encapsulation to form a base frame of the server development frame;
the basic View packaging module is used for inheriting the View class of the basic frame, expanding the View class to form a basic View component library and packaging the basic View component library;
the parameter checking and packaging module is used for packaging a parameter checking component library in the basic frame to form a basic server development frame;
and the cookie cutter engineering packaging module is used for packaging a preset cookie cutter engineering component library into the basic server development program framework to form a server development program framework.
7. The server developer framework of claim 6, wherein the base view encapsulation module comprises a check _ params standard function unit, a process standard function unit and an output standard function unit, wherein:
the check _ params standard function unit is used for adding a check _ params standard function, and the check _ params standard function is used for parameter verification standardization;
the process standard function unit is used for increasing a process standard function, and the process standard function is used for service processing standardization;
the output standard function unit is used for increasing an output standard function, and the output standard function is used for output processing standardization.
8. The server developer framework of claim 6, wherein the parameter verification encapsulation module comprises a hook function unit, a Param _ schema variable unit, and an output _ schema variable unit, wherein:
the hook function unit is used for calling input parameters and output parameters;
the Param _ schema variable unit is used for checking the input parameters;
and the output _ schema variable unit is used for checking the output parameter.
9. The server development program framework of claim 6, further comprising:
and the regular updating module is used for regularly updating the basic view component library, the parameter checking component library and the Cookiecuter engineering component library in the server development program framework.
10. The server development program framework of claim 6, further comprising:
and the regular maintenance module is used for regularly maintaining the server development program framework.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910600163.6A CN112181385A (en) | 2019-07-04 | 2019-07-04 | Server program framework development method and server development program framework |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910600163.6A CN112181385A (en) | 2019-07-04 | 2019-07-04 | Server program framework development method and server development program framework |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112181385A true CN112181385A (en) | 2021-01-05 |
Family
ID=73915229
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910600163.6A Pending CN112181385A (en) | 2019-07-04 | 2019-07-04 | Server program framework development method and server development program framework |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112181385A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1992725A (en) * | 2005-11-18 | 2007-07-04 | 国际商业机器公司 | Message oriented construction of web service |
US20120240098A1 (en) * | 2011-03-18 | 2012-09-20 | Viacom International, Inc. | Software Development and Publishing Platform |
CN105302568A (en) * | 2015-11-13 | 2016-02-03 | 山东中创软件工程股份有限公司 | Method for establishing Web development framework and Web development framework |
KR101865343B1 (en) * | 2017-05-29 | 2018-07-13 | 김희민 | Server-side framework device for development of web service application, method for executing web service application developmed using the same and computer program for the same |
CN109614084A (en) * | 2018-10-24 | 2019-04-12 | 蔚来汽车有限公司 | Web program and its rapid development framework, development method and related equipment |
CN109753532A (en) * | 2018-12-26 | 2019-05-14 | 苏州宏软信息技术有限公司 | Interface service system and its implementation method for browser end access database |
CN109960503A (en) * | 2017-12-26 | 2019-07-02 | 北京金风科创风电设备有限公司 | Component development method and device based on Django framework |
-
2019
- 2019-07-04 CN CN201910600163.6A patent/CN112181385A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1992725A (en) * | 2005-11-18 | 2007-07-04 | 国际商业机器公司 | Message oriented construction of web service |
US20120240098A1 (en) * | 2011-03-18 | 2012-09-20 | Viacom International, Inc. | Software Development and Publishing Platform |
CN105302568A (en) * | 2015-11-13 | 2016-02-03 | 山东中创软件工程股份有限公司 | Method for establishing Web development framework and Web development framework |
KR101865343B1 (en) * | 2017-05-29 | 2018-07-13 | 김희민 | Server-side framework device for development of web service application, method for executing web service application developmed using the same and computer program for the same |
CN109960503A (en) * | 2017-12-26 | 2019-07-02 | 北京金风科创风电设备有限公司 | Component development method and device based on Django framework |
CN109614084A (en) * | 2018-10-24 | 2019-04-12 | 蔚来汽车有限公司 | Web program and its rapid development framework, development method and related equipment |
CN109753532A (en) * | 2018-12-26 | 2019-05-14 | 苏州宏软信息技术有限公司 | Interface service system and its implementation method for browser end access database |
Non-Patent Citations (2)
Title |
---|
ZHI LI: "Design and Implementation of the Software Testing Management System Based on Django", APPLIED MECHANICS AND MATERIALS, 31 December 2014 (2014-12-31) * |
叶娜;: "Struts框架的扩展与改进", 计算机技术与发展, no. 12, 10 December 2007 (2007-12-10) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110647471B (en) | Interface test case generation method, electronic device and storage medium | |
CN110704518B (en) | Business data processing method and device based on Flink engine | |
CN112905459B (en) | Service interface testing method and device, electronic equipment and storage medium | |
US8689177B2 (en) | Integration environment generator | |
CN111258900A (en) | Interface test script generation method, system, equipment and storage medium | |
CN111061464B (en) | Analysis code generation method, device, equipment and storage medium | |
CN111506579B (en) | Method, program and equipment for generating intelligent contract code | |
CN110955410A (en) | Automatic code generation method, device, equipment and medium | |
CN112765023A (en) | Test case generation method and device | |
CN106886535A (en) | A kind of data pick-up method and apparatus for being adapted to multiple data sources | |
CN111078539A (en) | Test method, device, system and computer readable storage medium | |
US20200167209A1 (en) | Configurable Analytics For Microservices Performance Analysis | |
Rumpe | Agile test-based modeling | |
CN111414154A (en) | Method and device for front-end development, electronic equipment and storage medium | |
CN113127108A (en) | Service request processing method and device, storage medium and electronic equipment | |
CN107357588B (en) | Object code generation method and device | |
CN112130830A (en) | Interface generation method and device and electronic equipment | |
CN114741085A (en) | Data processing method, apparatus, equipment and storage medium | |
CN108536429B (en) | Method and device for developing software, storage medium and electronic equipment | |
CN112181385A (en) | Server program framework development method and server development program framework | |
CN112650488B (en) | Parameter verification method and device, storage medium and service terminal | |
CN115904317A (en) | Method, device, equipment and storage medium for uniformly calling front-end interface and back-end interface | |
CN112000366B (en) | System parameter configuration method and device based on code generator | |
US9195704B2 (en) | Automated logging for object-oriented environments | |
JP2012048329A (en) | Object oriented program generating device, method therefor and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |