Unlock instant, AI-driven research and patent intelligence for your innovation.

Front end data bidirectional binding realization method based on accessor hijack

An implementation method and accessor technology, applied in the direction of electrical digital data processing, instruments, program control devices, etc., can solve the problems of limited amount of monitoring data, page cycle time suspended animation, etc., to improve monitoring efficiency, simplify complexity, and improve development The effect of efficiency and maintenance efficiency

Inactive Publication Date: 2016-08-17
ZHEJIANG UNIV
View PDF2 Cites 17 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The implementation of data loop dirty detection will traverse all listeners in each event trigger. The more instructions and monitoring data on the page, the longer the traversal time, and the page may appear suspended animation due to too long loop time
Moreover, the amount of monitoring data that can be carried in a single page is also very limited

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Front end data bidirectional binding realization method based on accessor hijack
  • Front end data bidirectional binding realization method based on accessor hijack
  • Front end data bidirectional binding realization method based on accessor hijack

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0046] The first step is to add various necessary binding attributes in the label of the interface template, and specify the monitoring data name bound to the attribute. Various binding attributes are shown in Table 1. code show as below:

[0047]

[0048]

[0049]

[0050] Table 1 Binding attribute table

[0051]

[0052]

[0053] The second step is to create a ViewModel object to which the monitoring data belongs, and declare and initialize the monitoring data under it. code show as below:

[0054] var model = gs.define('hello', function(vm){

[0055] vm.name = null;

[0056]});

[0057] The third step is to scan the binding attribute on the interface label. When the monitoring data name bound by the binding property is the same as the monitoring data name under the ViewModel to which the label belongs, bind the DOM object corresponding to the label with the monitoring data .

[0058] The fourth step is to use the Object.defineProperty (define standard prop...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a front end data bidirectional binding realization method based on accessor a hijack. The method comprises the following steps that 1, all kinds of necessary binding attributes are added into an HTML label, and monitoring data names bound to the attributes are specified; 2, a ViewModel object to which monitoring data belongs is newly established, and the monitoring data subordinate to the ViewModel object is stated and initialized; 3, the binding attributes in the HTML label are scanned; 4, an Object.defineProperty interface is utilized for setting the attribute writable as true, setting the attribute enumerable as true and setting the attribute configurable as true for the data needing to be monitored; an initial value is set for the data needing to be monitored; an attribute rewriter (get method) is set for the data needing to be monitored; an attribute reader (set method) is set for the data needing to be monitored. By means of the method, effective management of data, interfaces and complicated dependent relations between the data and the interfaces in web applications can be realized, efficiency is higher, logic is clearer and more visual, and the size of the monitoring data supported by a single page is increased.

Description

technical field [0001] The invention relates to the management of a large amount of front-end element data, business logic and interfaces in complex web applications, and in particular to a method for realizing bidirectional binding of front-end data based on accessor hijacking. Background technique [0002] The early web applications were mainly for browsing, and the business logic was basically limited to the submission of the form. The role of javascript was reflected in the control of the form, and the complexity was low. At the end of the 1990s, ajax was born, which means that the browser can already carry more complex application functions. After 2010, with the wave of "web3.0", various large-scale web applications such as facebook and Weibo have matured. There are many framework plug-ins and complex systems of the program, and the complexity has reached a new level, which often makes development and maintenance at a loss. In order to better carry out modular developm...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44
CPCG06F8/38
Inventor 杜震洪张丰刘仁义徐溯阳
Owner ZHEJIANG UNIV