CN109582908A - A kind of web development methods and device - Google Patents
A kind of web development methods and device Download PDFInfo
- Publication number
- CN109582908A CN109582908A CN201811507172.2A CN201811507172A CN109582908A CN 109582908 A CN109582908 A CN 109582908A CN 201811507172 A CN201811507172 A CN 201811507172A CN 109582908 A CN109582908 A CN 109582908A
- Authority
- CN
- China
- Prior art keywords
- module
- data
- business
- user
- card
- 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
- 238000011161 development Methods 0.000 title claims abstract description 17
- 238000000034 method Methods 0.000 title claims abstract description 11
- 230000006870 function Effects 0.000 description 22
- 238000012546 transfer Methods 0.000 description 7
- 230000008859 change Effects 0.000 description 3
- 238000002347 injection Methods 0.000 description 2
- 239000007924 injection Substances 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 235000014510 cooky Nutrition 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
The present invention provides a kind of web development methods and devices, wherein webpage development device includes business data module, control module, display module and at least one card module;Business data module is transferred for storage bottom business datum and for each card module;Card module is the business function module being packaged by least one bottom function, control module is for receiving user's request instruction, and user's request instruction is sent to display module, display module is used to request the determination data to be shown according to user, user's request instruction is sent to card module by display module, after card module receives instruction, called data and the data transferred are sent to display module it are shown from business data module.The present invention reduces executable function list, provides specification, safe called data mode.Code confusion is prevented, source code flexible is improved.
Description
Technical field
The invention belongs to technical field of data processing, in particular to a kind of web development methods and device.
Background technique
When carrying out Web exploitation, code uses MVC framework mostly.MVC pattern is a kind of mode of code organization.MVC is complete
Name is Model View Controller, is the contracting of model (model)-view (view)-controller (controller)
It writes, a kind of software design model, the method tissue code separated with a kind of service logic, data, interface display.Model layers negative
Duty business datum is transferred, and View is responsible for showing interface, and Controller is responsible for receiving request, transfers Models as control layer
Data pass data to specific View and are shown.
When View layers of dynamic change, such as illustrate by taking following dynamic View scene as an example, after different user logs in website
Platform, it is seen that the page it is completely different, this species diversity be by user height it is customized.View code is write by user, without
It is to be write by webmaster.For example party A-subscriber is arranged oneself homepage and shows nearest visitor, oneself logs in record;Party B-subscriber sets
The blogroll that homepage shows oneself is set, blog classification of oneself etc..The differentiation of this View cannot be predicted in advance.Needle
To this scene, Controller in the request for being connected to user, due to do not know in advance View layers needs business datum and
Data format, so and do not know need from Models which kind of data transferred, do not know to transmit which kind of data more to View.In order to solve
Drawbacks described above, someone Discuz etc. open source program in improve, open source program in, View layers be by user's control,
That is View layers are dynamic changes, solution used in program of increasing income is in the View layers of primary function of open PHP
Function is transferred, function is more casual, can transfer in View layers and realize types of functionality with the primary function of all kinds of PHP, surface has been seen
Carry out function more light weight, be easier to use, but from safety, can safeguard that level has many problems.Safe level: the open source program such as Discuz
Substantially open the function of all PHP primary function and default.Primary function such as sleep of PHP itself can consume many systems
System resource, while some operative combinations can also generate the total safety problem of very Yan.It can safeguard level: if View layers can be with
Meaning transfers each class function, Model, may need to add Hook in data Layer in the future, system will become complicated.Therefore, directly
Open function is that have opened institute functional, had not only standardized, but also dangerous.
Summary of the invention
The purpose of the present invention is to provide a kind of web development methods and devices, for solving in the prior art when View layers
Used development plan is lack of standardization when dynamic change and unsafe problem.
To achieve the above object, the present invention provides a kind of webpage development devices, including business data module, control mould
Block, display module and at least one card module;The business data module is for storage bottom business datum and supplies each plug-in unit
Module calls;Card module is the business function module being packaged by least one bottom function, and the control module is for connecing
User's request instruction is received, and user's request instruction is sent to display module, the display module is used to be requested according to user true
Surely the data to be shown, user's request instruction is sent to card module by the display module, after card module receives instruction,
It called data and the data transferred is sent to the display module is shown from the business data module.
Further, card module will be put into caching from the data transferred in business data module, the data that will be transferred
Display module is sent to from caching.When multiple called data, it is only necessary to go request data for the first time, be asked for subsequent
It asks, card module is read directly from caching reads data, to not have to the storage system outside, when reducing the io of system
Between.
The present invention also provides a kind of web development methods, including business data module, control module, display module and extremely
A few card module;The business data module is transferred for storage bottom business datum and for each card module;Plug-in unit mould
Block is the business function module being packaged by least one bottom function, and the control module is used to receive user's request instruction,
And user's request instruction is sent to display module, the display module is used to request the determination data to be shown according to user,
User's request instruction is sent to card module by the display module, after card module receives instruction, from the business datum
It called data and the data transferred is sent to the display module is shown in module.
Further, card module will be put into caching from the data transferred in business data module, the data that will be transferred
Display module is sent to from caching.When multiple called data, it is only necessary to go request data for the first time, be asked for subsequent
It asks, card module is read directly from caching reads data, to not have to the storage system outside, when reducing the io of system
Between.
The beneficial effects of the present invention are:
Webpage development device of the invention includes business data module, control module, display module and at least one plug-in unit
Module;Business data module is transferred for storage bottom business datum and for each card module;Card module is by least one
The business function module that bottom function is packaged into, control module send out user's request instruction for receiving user's request instruction
Give display module, display module is used to request the determination data to be shown according to user, and display module is by user's request instruction
Be sent to card module, after card module receives instruction, from business data module called data and by the data transferred send out
Display module is given to be shown.The present invention reduces executable function list, provides specification, safe called data
Mode.Code confusion is prevented, source code flexible is improved.
Detailed description of the invention
Fig. 1 is the structural block diagram of webpage development device of the invention.
Specific embodiment
A specific embodiment of the invention is further described with reference to the accompanying drawing:
The present invention provides a kind of webpage development device, including business data module, control module, display module and at least
One card module;Business data module is transferred for storage bottom business datum and for each card module;Card module is served as reasons
The business function module that at least one bottom function is packaged into, control module ask user for receiving user's request instruction
It asks the instruction to be sent to card module, after card module receives instruction, called data and will be transferred from business data module
Data are sent to display module and are shown.
The full name of MVC is Model View Controller, wherein Model is business data module, and View is to open up
Show module, Controller is control module.Model layers of responsible business are transferred, Controller layers of correspondence one or can be pre-
Know that the View template of quantity, the Controller layers of logic according to oneself are transferred different business datums (Models), then will be counted
According to View is passed to, View is not write by website personnel, is write by user.It is different that different users can be such that View occurs
The case where, since View is dynamic change, Controller does not know to need from Model layers in the request for receiving user
Which kind of data is transferred, as shown in Figure 1, the present embodiment increases Plugin module newly on the basis of original MVC, Plugin module is
Card module, can include all add-on files of this project in Plugin module, and project can load all insert in initialization
Part.Plug-in unit is closely related with business, is the encapsulation of business function, and View layers are directly transferred plug-in unit.Therefore it is needed in plug-in unit
All kinds of Model are transferred, have the service such as caching, full-text search in plug-in unit, while it is unified to provide data format, data buffer storage etc.
Service, full article retrieval belong to third party's service, and third party's service is primarily to finishing service needs.According to different business
Scene, plug-in unit can also realize it is more multi-functional, so as to View layers use.
Same part data are repeatedly shown since a page is likely to require, if do not cached in card module
Function needs to start the data in card module and transfers logic, wastes cpu resource.When having caching function, number is repeatedly transferred
According to when, only going request data for the first time, for subsequent request, card module can directly read data from caching.Caching
It is directly to be stored using the static variable of programming language, is not suitable for external storage system, reduces the io time of system.
The present invention also provides a kind of web development methods, comprising the following steps:
1, user initiates page request according to their own needs.
2, control module (Controller) receives user's request instruction, and control module does letter according to the required parameter of user
Single data processing, such as the read-write of Cookie etc..
3, View is rendered:
The user's request instruction received is sent to display module by control module, and display module requests to determine according to user
The data to be shown, and user's request instruction is sent to card module, after card module receives instruction, from business datum mould
It called data and the data transferred is sent to display module is shown in block.
Core of the invention is the data transfer mode for optimizing original MVC framework.In MVC framework, Controller layers are needed
It wants called data and passes to View, is i.e. View relies on Controller.Settling mode of the invention and " dependence injection, control
The concept of reversion " is quite similar.Injection is relied on, original View layers depends on Controller layers, and Controller layers must pass
Delivery data is come in, and View layers could render the page.It is a feature of the present invention that Controller layers do not transmit real data into
Come, but by card module business transferring data to View layers, View layers be free to obtain the data needed, eliminate the reliance on
Controller layers.
As other embodiments, do not knowing that Controller can also transfer institute when needing which kind of data in view
The data being likely to require pass to View, and view only renders the data of oneself needs.Disadvantage: resource serious waste.
As other embodiments, when needing which kind of data in unknown View, view syntax analyzer is write, is analyzed
The data needed in view.After obtaining the data needed, dynamic view problem is just resolved.Using traditional MVC pattern,
Controller obtains data and passes to View again.Disadvantage: view may be write by layman (user), and data transfer lattice
Formula is lack of standardization, and mandatory requirement grammer can unanimously there is a problem of executing.Meanwhile grammer it is consistent when, view analyzer is one
A syntax analyzer, workload can be far beyond expections.
Specific embodiment is presented above, but the present invention is not limited to embodiment described above.The present invention
Basic ideas be above-mentioned basic scheme, for those of ordinary skill in the art, introduction according to the present invention is designed each
The model of kind deformation, formula, parameter do not need to spend creative work.The case where not departing from the principle and spirit of the invention
Under to embodiment carry out variation, modification, replacement and deformation still fall in protection scope of the present invention.
Claims (4)
1. a kind of webpage development device, which is characterized in that including business data module, control module, display module and at least one
A card module;The business data module is transferred for storage bottom business datum and for each card module;Card module is
The business function module being packaged by least one bottom function, the control module are used to receive user's request instruction, and will
User's request instruction is sent to display module, and the display module is used to request the determination data to be shown according to user, described
User's request instruction is sent to card module by display module, after card module receives instruction, from the business data module
The data transferred simultaneously are sent to the display module and are shown by middle called data.
2. webpage development device according to claim 1, which is characterized in that card module will be adjusted from business data module
The data taken are put into caching, and the data transferred are sent to display module from caching.
3. a kind of web development methods, which is characterized in that use business data module, control module, display module and at least one
The framework that a card module is formed, the business data module are transferred for storage bottom business datum and for each card module;
Card module is the business function module being packaged by least one bottom function, and the control module is for receiving user's request
Instruction, and user's request instruction is sent to display module, the display module is used to request determination to be shown according to user
Data, user's request instruction is sent to card module by the display module, after card module receives instruction, from the business
It called data and the data transferred is sent to the display module is shown in data module.
4. web development methods according to claim 3, which is characterized in that card module will be adjusted from business data module
The data taken are put into caching, and the data transferred are sent to display module from caching.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811507172.2A CN109582908A (en) | 2018-12-10 | 2018-12-10 | A kind of web development methods and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811507172.2A CN109582908A (en) | 2018-12-10 | 2018-12-10 | A kind of web development methods and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109582908A true CN109582908A (en) | 2019-04-05 |
Family
ID=65928081
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811507172.2A Pending CN109582908A (en) | 2018-12-10 | 2018-12-10 | A kind of web development methods and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109582908A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064663A (en) * | 2012-11-19 | 2013-04-24 | 北京百度网讯科技有限公司 | Browser plug-in generating, issuing, loading and updating method and system |
CN104866327A (en) * | 2015-06-19 | 2015-08-26 | 上海斐讯数据通信技术有限公司 | PHP development method and frame |
WO2016206566A1 (en) * | 2015-06-26 | 2016-12-29 | 阿里巴巴集团控股有限公司 | Processing method, device, and system of web request |
CN107545195A (en) * | 2017-09-11 | 2018-01-05 | 浙江大学 | A kind of encrypted master application development frameworks and method |
-
2018
- 2018-12-10 CN CN201811507172.2A patent/CN109582908A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064663A (en) * | 2012-11-19 | 2013-04-24 | 北京百度网讯科技有限公司 | Browser plug-in generating, issuing, loading and updating method and system |
CN104866327A (en) * | 2015-06-19 | 2015-08-26 | 上海斐讯数据通信技术有限公司 | PHP development method and frame |
WO2016206566A1 (en) * | 2015-06-26 | 2016-12-29 | 阿里巴巴集团控股有限公司 | Processing method, device, and system of web request |
CN107545195A (en) * | 2017-09-11 | 2018-01-05 | 浙江大学 | A kind of encrypted master application development frameworks and method |
Non-Patent Citations (2)
Title |
---|
张胜文等: "基于平台/插件软件架构的CAPP***研究", 《江苏科技大学学报(自然科学版)》 * |
蓝色雨敏: ""CI映射(加载)数据到view层的方法"", 《HTTPS://WWW.JB51.NET/ARTICLE/81603.HTM》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104866383B (en) | Interface calling method and device and terminal | |
CN101452397B (en) | Forced access control method and apparatus in virtual environment | |
US10262008B2 (en) | Filename-based inference of repository actions | |
CN103399942B (en) | A kind of data engine system supporting the many tenants of SaaS and method of work thereof | |
US11948014B2 (en) | Multi-tenant control plane management on computing platform | |
CN102904889B (en) | Support the forced symmetric centralization system and method for cross-platform unified management | |
CN103942052A (en) | Service container engine | |
CN109933317B (en) | Point burying method, device, server and readable storage medium | |
CN102938776A (en) | Dynamic page processing system based on Asynchronous JavaScript and XML (ajax) technique | |
CN104517181B (en) | Enterprise content management system and method for nuclear power station | |
CN103780684A (en) | Method for data sharing among intelligent equipment based on file system | |
CN103019726A (en) | Management method and device of software system service rules | |
CN109657177A (en) | The generation method of the page, device, storage medium and computer equipment after upgrading | |
CN109670126B (en) | Cross-border access acceleration method and device | |
CN106326129A (en) | Program abnormity information generating method and device | |
CN108763963A (en) | Distributed approach, apparatus and system based on data access authority | |
CN105917307B (en) | User interface frame | |
US10291746B2 (en) | Context switch of database connections | |
CN107895044B (en) | Database data processing method, device and system | |
CN109582908A (en) | A kind of web development methods and device | |
CN103501341A (en) | Method and device for establishing Web service | |
US20200327427A1 (en) | System for deriving data in constrained environments | |
US11436359B2 (en) | System and method for managing permissions of users for a single data type column-oriented data structure | |
CN103077081B (en) | Method and device of adjusting resources | |
CN103971064B (en) | The user authority control method of Linux system |
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: 20190405 |