Implementing efficient Dynamic Web pages with data binding (author: Chen Yuan December 25, 2000 10:06)

Source: Internet
Author: User
Data binding (Binding) is not a new concept, IE 4.0 has been given a wealth of support. However, data binding has not been given the attention it deserves, and many developers seem more willing to use server-side scripting. In practice, however, data binding is more efficient in terms of both the code implementation of dynamic Web pages and the productivity of dynamic Web pages.
This paper will introduce the architecture, working principle and implementation of data binding, and finally make comparison and conclusion between the two methods in terms of programming workload and Web page efficiency.
First let's look at a simple example. A Web page shows the current inventory of the warehouse, the user can choose their own way to sort the data: by the name of the goods, prices, inventory and other orders. Using server-side technologies such as CGI, ISAPI, or ASP middleware, the application script will submit at least n times the data request to the server if the user needs n sort methods. For the same content of data, just because of the different display mode, it is necessary to do a number of database operations, consuming a lot of network bandwidth.
Another common example is that when a large amount of data needs to be paged out, each page will need to be reconnected to the server, submit a query request, and then locate the data. For these similar problems, data binding provides an efficient solution.
 
The architecture and working principle of data binding
The data-binding architecture consists of four components: the data source object, the data display object (consumers), and the two agents (the Binding agent and the table Reptition agent). The data source object provides data to the Web page, and the data display object is the HTML element that displays the data, and the agent is used to keep the work of the first two synchronized. Figure 1 shows the principle of the four parts working together.
As shown in Figure 1, the data source object is responsible for communicating with the background database server and caching the data returned by DB Server as a collection in the local cache. Thereafter, any operations on the dataset, such as sorting, filtering, subsets, and so on, are done in the local cache, and the agent is responsible for communication and synchronization between the data source and the HTML elements that display the data.
Http://www.ccidnet.com/tech/web/2000/12/25/image/001225i1-1.jpg
Figure 1
This way of working with data binding makes it possible for program developers to minimize the amount of script programming by using extended HTML and pluggable data source objects. Compared to the traditional server-side script-generated web pages, once the data has been downloaded to the client, no additional server requests are required for any operations on the data, thus saving network bandwidth and increasing the download speed.
Implementation of data binding
This section describes each of its components and their implementation, based on the architecture of the data binding.
1. Data source Object
The first step in implementing data binding is to determine the data to be displayed on the Web page, select a suitable Data source object (DSO), and then refer to the DSO in the Web page. The flexibility of data binding first in support of a variety of Dso,ie 4.0 and above supports the following DSO types:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.