CN106815011A - A kind of aided programming method and system - Google Patents

A kind of aided programming method and system Download PDF

Info

Publication number
CN106815011A
CN106815011A CN201611136476.3A CN201611136476A CN106815011A CN 106815011 A CN106815011 A CN 106815011A CN 201611136476 A CN201611136476 A CN 201611136476A CN 106815011 A CN106815011 A CN 106815011A
Authority
CN
China
Prior art keywords
instruction
page
http request
mdac
business logic
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
CN201611136476.3A
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.)
FARAD ELECTRIC Co Ltd
Original Assignee
FARAD ELECTRIC 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 FARAD ELECTRIC Co Ltd filed Critical FARAD ELECTRIC Co Ltd
Priority to CN201611136476.3A priority Critical patent/CN106815011A/en
Publication of CN106815011A publication Critical patent/CN106815011A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Abstract

The invention discloses one kind programming householder method, comprise the following steps:A, offer UI generate http request to obtain guest operation based on guest operation;B, parsed based on web.handler and http request and export page code and instruction;C, business logic components are transferred connecting MDAC based on page code and instruction.One kind programming accessory system, including:Interface presentation layer, for providing UI to obtain guest operation, http request is generated based on guest operation;Control routing layer, for parsing http request based on web.handler and exporting page code and instruction;Business Logic, for transferring business logic components to connect MDAC based on page code and instruction;Data access layer, including MDAC and corresponding database.The present invention uses web.handler to develop framework as the MVC of page route test, it is not necessary to go to configure routing table, function pages are route simply by URL parameter is changed, remove numerous abbreviation, improve development efficiency.

Description

A kind of aided programming method and system
Technical field
The present invention relates to a kind of aided programming method and system, belong to computer realm.
Background technology
ASP.NET is one of mainstream technology of WEB application exploitation, because Microsoft uses WebForm frameworks, the technology early stage In the industry cycle unanimously be considered that introduction is simple, but be proficient in not too much easily, the knowledge point study that it is related to is very more, and Microsoft frame Structure version updating and technology iteration are very fast, and the later stage is proposed ASP.NET MVC frameworks again, and constantly upgrades, in this process In allow developer when technology development study is stayed close, can be unable to do what one wants very much to do, particularly to the new hand of firm introduction, for numerous Miscellaneous knowledge train of thought, learning cost more and more higher, and can not be proficient in, introduction requires also relative raising;Some are demonstrate,proved simultaneously The interface of real practicality and stability, can be helpful with cultivation new person to fast programming if a large amount of uses;General MVC frameworks are, it is necessary to configure routing table, configuration process is more complicated.
The content of the invention
In order to solve the above problems, the present invention is by providing a kind of aided programming method and system.
On the one hand the technical solution adopted by the present invention is a kind of programming householder method, is comprised the following steps:A, provide UI with Guest operation is obtained, http request is generated based on guest operation;B, parsed based on web.handler and http request and export the page Code and instruction;C, business logic components are transferred connecting MDAC based on page code and instruction.
Preferably, step B obtains the URL parameter of http request by ProcessRequest, according to the principle of reflection of class, Output page code and instruction.
Preferably, the URL parameter includes:Page function coding, it is P parameters to mark it, right for being found by reflection The page control file LoginProc.cs for answering, invoking page controls the ActionDispatcher methods in class to transfer business Logic module is connecting MDAC;Instruction encoding, it is act parameters to mark it, for finding corresponding page by reflection Face controls file LoginProc.cs, the corresponding method of call instruction.
Preferably, the MDAC includes API and description of use data.
Preferably, step B also includes the result based on parsing http request, exports error information.
On the other hand the technical solution adopted by the present invention is a kind of programming accessory system, including:Interface presentation layer, for carrying For UI to obtain guest operation, http request is generated based on guest operation;Control routing layer, for being solved based on web.handler Analysis http request simultaneously exports page code and instruction;Business Logic, for transferring service logic based on page code and instruction Component is connecting MDAC;Data access layer, including MDAC and corresponding database.
Beneficial effects of the present invention are to develop framework using web.handler as the MVC of page route test, it is not necessary to Go to configure routing table, function pages are route simply by URL parameter is changed, remove numerous abbreviation, improve development efficiency.
Brief description of the drawings
Fig. 1 show a kind of schematic diagram of the programming householder method based on the embodiment of the present invention;
Fig. 2 show the schematic diagram of the frame structure based on the embodiment of the present invention;.
Specific embodiment
The present invention will be described with reference to embodiments.
Based on inventive embodiment 1, a kind of programming householder method, comprises the following steps as shown in Figure 1:A, UI is provided obtaining Guest operation is taken, http request is generated based on guest operation;B, parsed based on web.handler and http request and export page generation Code and instruction;C, business logic components are transferred connecting MDAC based on page code and instruction.
The first step first is to provide a UI, including some image conversions functional unit, the corresponding function group of customer selecting Part, then exports http request;Web.handler parses http request, distinguishes the function group that client therein needs to access The code of the instruction that the position (page code) of part and needs are performed, such as patterned auxiliary is transferred based on these codes The business logic components such as component, Route guiding component, are connected to MDAC, while by MDAC with graphical Mode export UI interfaces.
Based on inventive embodiment 2, whole accessory system is divided into key-course and interface layer, and key-course includes four aspects, Route test and self-defined is instructed including the control of the Aplication websites overall situations, Controllers functions route test, Action Exception control, wherein,
1) the global control in Aplication websites
The HttpApplication operation logics for using ASP.NE, by Application_Start and Application_End events, realize the loading in application program launching and closing to WEB key-course dynamic link libraries and unload Carry.Main code is as follows:
Note:It is main to use comprising the implementation method to dynamic link library dynamic load and unloading in WebDLLLoader classes Be C# reflection technologies
2) Controllers functions route test
It is the HttpHandler operation logics for using ASP.NE, URL parameter is intercepted and captured in ProcessRequest methods, Using the rules of order appointed, according to the principle of reflection of class, corresponding page program file is found, perform its entry method.
For example:By the use of WebHandler files Dispatch.ashx as route distribution device, one is input into a browser With " p " parameter request pathhttp://localhost/Views/Dispatch.ashxP=Login(p parameters are arranged It is the initial of page function coding, i.e. Page), the corresponding page is found by reflection and controls file LoginProc.cs (texts Part name is about set to page function coding+Proc), and the ActionDispatcher methods in invoking page control class, so as to enter Enter page operation layer logic entrance.
3) Action instructions route test
Ibid principle, increases parameter in URL " act ", using the rules of order appointed, find the corresponding side of execution Method.
For example:Request path ishttp://localhost/Views/Dispatch.ashxP=Login&act= VerifyUser(act parameters are about set to the abbreviation of instruction encoding, i.e. action), corresponding operation layer file is found by reflection LoginPage.cs (filename conventions are page function coding+Page), to the corresponding method of call instruction.
Note:To be described in detail in following project solutions for the realization of LoginPage.cs classes
4) self-defined exception control
For the exception error occurred in request process, user or keeper close friend are reported an error according to custom rule.
Interface layer is the encapsulation to general service code in program development, to reduce the redundancy and complexity of program code, Mainly include following 14 interfaces
1) database adaptable interface:Some interface methods that developer needs to use in operating database are provided, can To be adapted to some Sybases such as SQL Server, Oracle, MySQL;
2) data cache interface:Offer needs the implementation method of the various data buffer storages used on stream;
3) data encryption/decryption interface:The encryption and decryption approaches that needs are used when offer is related to data safety;
4) journalizing interface:The interface method of system journal write-in is provided;
5) Json seriations interface:The interface method that different pieces of information structure is automatically converted into Json object data is provided;
6) the anti-seriation interface of XML seriations:XML file is converted into the interface side of data object and inverse conversion for offer Method;
7) FTP operate interfaces:The FTP relevant interface methods of operation are provided;
8) files passe interface:The interface method used during files passe is provided;
9) file download interface:The interface method used during file download is provided;
10) Excel operate interfaces:Offer carries out the interface of the certain methods of data write-in and reading to Excel file;
11) Word operate interfaces:Offer carries out the interface of the certain methods of data write-in and reading to Word file;
12) Pdf operate interfaces:Offer carries out the interface of the certain methods of data write-in and reading to Pdf files;
13) mail service interface:The interface of the certain methods that mail sends and receives is provided;
14) short message service interface:The interface of short message sending and the certain methods for receiving is provided.
Step B obtains the URL parameter of http request by ProcessRequest, according to the principle of reflection of class, output page Face code and instruction.
The URL parameter includes:Page function coding, it is P parameters to mark it, for finding the corresponding page by reflection Control file LoginProc.cs, invoking page controls the ActionDispatcher methods in class to transfer business logic components To connect MDAC;Instruction encoding, it is act parameters to mark it, and text is controlled for finding the corresponding page by reflection Part LoginProc.cs, the corresponding method of call instruction.
The MDAC includes API and description of use data.
Step B also includes the result based on parsing http request, exports error information.
On the other hand the technical solution adopted by the present invention is a kind of programming accessory system, including:Interface presentation layer, for carrying For UI to obtain guest operation, http request is generated based on guest operation;Control routing layer, for being solved based on web.handler Analysis http request simultaneously exports page code and instruction;Business Logic, for transferring service logic based on page code and instruction Component is connecting MDAC;Data access layer, including MDAC and corresponding database.
Project solutions are the code development architectural schemes based on Web core libraries, using four layers of knot of development mode of MVC The mode of structure is developed, respectively showing interface layer, route test layer, Business Logic and data access layer.Wherein showing interface Layer and with route test layer build in same ASP.NET web applications project, Business Logic and data access layer are all Developed using independent class libraries, structure is as shown in Figure 2.
1. certain naming rule constraint is needed in project solutions, it is as follows respectively:
1) item designation:As item designation is DEMO in Fig. 2;
2) solution title:Treaty rule is item designation+Solution modes, is DEMOSolution in Fig. 2
3) project name:
Presentation layer and route test layer project name are:Treaty rule is item designation, is DEMO in Fig. 2
Business Logic project name is:Treaty rule is item designation+" .BLL ", is DEMO.BLL in Fig. 2
Data access layer project name is:Treaty rule is item designation+" .DAL ", is DEMO.DAI in Fig. 2
4) file name:Two files are set up in presentation layer and distinguishes entitled Controllers and Views;
5) file designation:When a page function is developed, need to include 5 files altogether, as shown in Fig. 2 page work( Login can be encoded to, then needs to set up two files of Login.html and Login.js in Views files, LoginProc.cs files are set up in Controllers files, is set up in Business Logic DEMO.BLL class libraries LoginPage.cs files and set up Login.cs files in data access layer DEMO.DAL class libraries.
2. website general file
In the project developed based on Web core libraries, it is necessary to as follows respectively including 4 public documents:
Default.aspx
It is the start page of website operation, its backstage control routine is inherited in Web core libraries Farad.CSharp.Web.UI.Default classes, for User Defined site promoter start page, its code is:
<%@Page Language=" C# " AutoEventWireup=" true "
Inherits=" Farad.CSharp.Web.UI.Default " %>
Global.asax
For the application-level file of website provides globally available code, its backstage control routine is inherited in Web core libraries In Farad.CSharp.Web.Handlers.HttpApplication classes, the initialization for controlling dynamic link library adds Carry and unloaded with the end of, its code is:
<%@Application Language=" C# "
Inherits=" Farad.CSharp.Web.Handlers.HttpApplication " %>
Web.config
It is the configuration file of website, configuration log rank, daily record storage folder, Web dynamic links library name and system The parameters such as login page.
Its configuration code is:
It is the routing file of Website page, all of request path is all used
http://localhost/Views/Dispatch.ashxP=xxxxForm, by p parameters transmit the page Encode to switch obstructed page function, it is necessary to be placed under Views files, its backstage control routine is inherited in Web core libraries In Farad.CSharp.Web.Handlers.DispatchHandler classes, its code is:<%@WebHandler Language=" C# " Class=" Farad.CSharp.Web.Handlers.DispatchHandler " %>
3. the realization of page function code
The exploitation of each page function needs to set up 5 files, by taking the function that the page is encoded to Login as an example:
Showing interface 2 file (Login.html and Login.js) of layer, are placed under Views files, using structure and The mode that behavior is separate, it is possible to use any front end frame and Component Gallery, does not have hard requirement, it is proposed that open using jQuery storehouses Hair, front and rear end communication uses Ajax asynchronous communications.
Route test file (LoginProc.cs), is placed under Controllers files, necessary in LoginProc classes Web core libraries are quoted, ActionController abstract class is inherited, and rewrites ActionDispatcher methods, implemented Code is as follows:
Business Logic file (LoginPage.cs), is placed in Business Logic class libraries, must draw in LoginPage classes Web core libraries are used, PageBase abstract class is inherited, and needs to write the constructed fuction that constructed fuction inherits base class, implemented Code is as follows:
Data access layer file (Login.cs), is placed in data access layer class libraries, needs to quote Web cores in Login classes Heart storehouse, but without inheriting and realizing any class and interface, the method in class is all realized using static method, writes database behaviour The interrelated logic code of work.
The above, simply presently preferred embodiments of the present invention, the invention is not limited in above-mentioned implementation method, as long as It reaches technique effect of the invention with identical means, should all belong to protection scope of the present invention.In protection model of the invention Its technical scheme and/or implementation method can have a variety of modifications and variations in enclosing.

Claims (6)

1. it is a kind of to program householder method, it is characterised in that to comprise the following steps:
A, offer UI generate http request to obtain guest operation based on guest operation;
B, parsed based on web.handler and http request and export page code and instruction;
C, business logic components are transferred connecting MDAC based on page code and instruction.
2. one kind according to claim 1 programs householder method, it is characterised in that step B passes through ProcessRequest The URL parameter of http request is obtained, according to the principle of reflection of class, page code and instruction is exported.
3. one kind according to claim 2 programs householder method, it is characterised in that the URL parameter includes:
Page function coding, it is P parameters to mark it, and file is controlled for finding the corresponding page by reflection LoginProc.cs, invoking page controls the ActionDispatcher methods in class to transfer business logic components to connect number According to access component;
Instruction encoding, it is act parameters to mark it, and file LoginProc.cs is controlled for finding the corresponding page by reflection, The corresponding method of call instruction.
4. one kind according to claim 1 programs householder method, it is characterised in that the MDAC includes API With description of use data.
5. one kind according to claim 1 programs householder method, it is characterised in that step B is also included based on parsing http The result of request, exports error information.
6. it is a kind of to program accessory system, it is characterised in that including:
Interface presentation layer, for providing UI to obtain guest operation, http request is generated based on guest operation;
Control routing layer, for parsing http request based on web.handler and exporting page code and instruction;
Business Logic, for transferring business logic components to connect MDAC based on page code and instruction;
Data access layer, including MDAC and corresponding database.
CN201611136476.3A 2016-12-09 2016-12-09 A kind of aided programming method and system Pending CN106815011A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611136476.3A CN106815011A (en) 2016-12-09 2016-12-09 A kind of aided programming method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611136476.3A CN106815011A (en) 2016-12-09 2016-12-09 A kind of aided programming method and system

Publications (1)

Publication Number Publication Date
CN106815011A true CN106815011A (en) 2017-06-09

Family

ID=59108902

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611136476.3A Pending CN106815011A (en) 2016-12-09 2016-12-09 A kind of aided programming method and system

Country Status (1)

Country Link
CN (1) CN106815011A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114996765A (en) * 2022-08-01 2022-09-02 广州市千钧网络科技有限公司 JavaScript-based page control method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130298007A1 (en) * 2012-04-18 2013-11-07 International Business Machines Corporation Determining page loading of user interfaces of web applications
CN104980459A (en) * 2014-04-04 2015-10-14 中国移动通信集团广东有限公司 Application program operation method and site access device
CN105843609A (en) * 2016-03-18 2016-08-10 浪潮软件集团有限公司 MVC frame based on Spring and MyBatis

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130298007A1 (en) * 2012-04-18 2013-11-07 International Business Machines Corporation Determining page loading of user interfaces of web applications
CN104980459A (en) * 2014-04-04 2015-10-14 中国移动通信集团广东有限公司 Application program operation method and site access device
CN105843609A (en) * 2016-03-18 2016-08-10 浪潮软件集团有限公司 MVC frame based on Spring and MyBatis

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘铭.NET: ""更灵活,更易维护的Webhandler之通用webhandler编码方案(1)"", 《HTTPS://WWW.CNBLOGS.COM/NEWMIN/ARCHIVE/2010/09/29/WEB_HANDLER.HTML》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114996765A (en) * 2022-08-01 2022-09-02 广州市千钧网络科技有限公司 JavaScript-based page control method and device and electronic equipment

Similar Documents

Publication Publication Date Title
US20230367954A1 (en) Systems and methods of a script generation engine
US20200257437A1 (en) Methods and systems for web content generation
US10216554B2 (en) API notebook tool
US8209341B2 (en) Configurable transformation macro
US20080127133A1 (en) Aggregating portlets for use within a client environment without relying upon server resources
CN104714982A (en) Method and system for loading webpage
CN104636139A (en) Visualized cross-platform mobile application development and generation system
Dory et al. Introduction to tornado
Jurney Agile data science: building data analytics applications with Hadoop
CN104252521A (en) Web content management using predetermined project templates
US20190266183A1 (en) Unbounded list processing
Varanasi et al. Spring Rest
Balachandar RESTful Java Web Services: A pragmatic guide to designing and building RESTful APIs using Java
US20240080354A1 (en) Providing bulk server-side custom actions for multiple rows of a client-side spread sheet
Betari et al. Model transformations in the MOF meta-modeling architecture: from UML to codeIgniter PHP framework
CN106815011A (en) A kind of aided programming method and system
US10331781B2 (en) Template compilation using view transforms
US20200394152A1 (en) Digital design application plugin for content updates and delivery
Turkington et al. Learning Hadoop 2
Karlík Blogging platform utilizing Kentico Cloud and Jekyll static site generator
Li et al. Portal-based design for SaaS system presentation layer configurability
Microservices et al. Spring REST
Qi et al. Research of Struts2 framework and web application based on Ajax
Nenadić et al. Rendering of JSON-LD CIM profile using web components
Prakapenka Quality control application for wood products

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

Application publication date: 20170609