Regular Binding Mode vs Regular Server Mode vs Instant Feedback Mode

In this topic, the term grid control refers to a data-aware control that supports a server mode.

在这个主题,grid control是一个支持服务模式的数据感知控件。

Regular Binding Mode vs Regular Server Mode vs Instant Feedback Mode
一般绑定模式VS一般服务模式VS即时回馈模式
 

In a regular data binding mode, data must be transferred in its entirety from a data store into memory, before it is displayed within a grid control. The number of records can

在一般数据绑定模式,在数据在一个grid control里显示之前,数据会从数据源全部传送到内存。有大量的数据时会引发瓶颈问题:

 cause a bottleneck: the more records there are the more time is required to load data. Moreover, a grid's performance also depends on the total number of loaded records,

数据越多,需要载入数据的时间越多。而且,一个grid性能是由载入它的总记录数决定的,

 particularly when data is sorted, grouped, filtered or the summary feature is used. In this case, a grid needs to process an entire recordset to implement a specific data-aware operation.

特别是在数据的排序,分组,过滤或者摘要功能被用的时候。在这种情况下,这个gird需要去处理整个记录集来执行一个具体的数据感知操作。

Server modes (regular server mode and Instant Feedback mode) have been specifically designed to work with large datasets. Bound data is not loaded into memory in its

服务器模式(包括一般服务器模式和即时回馈模式)就是明确地设计来处理大型数据集的。绑定的数据不是都载入内存。

entirety. Instead, the grid control loads data in small portions on demand. When a grid starts, it loads and displays the first portion of data from a data store. Then, as an end-

而是gird控件根据需要载入一小部分数据。当启动一个grid,它从数据源下载并显示第一部分数据。

user scrolls the grid and the last record of the loaded subset is reached, the grid requests the data store to return a subsequent data portion.

然后当终端用户滚动grid,后面的加载子集的数据才会到达内存,gird请求数据源返回随后加载进内存的一部分数据。

For end-users, the grid control functions identically in regular and server modes. In server mode, they can scroll the grid and use anautomatic filtering feature to access a

对终端用户来说,grid控件的功能在一般的数据模式和服务器模式是一样的。在服务器模式,他们能滚动grid并且用自动过滤功能来访问

particular data range, sort, group and filter data, and calculate summaries.

特殊的数据范围,数据排序,数据分组及数据过滤,以及计算功能。

In a regular binding mode, a grid control has simultaneous access to all data, and performs data-aware operations itself (e.g. sorting, grouping, filtering records and calculating

在一般的数据绑定模式,一个grid控件同时访问所有数据,并执行数据感知操作(例如排序,分组,过滤数据和计算总结)。

 summaries). In server modes, a grid control has simultaneous access only to a small amount of data at a time, and therefore cannot perform any data-aware operations itself.

在服务器模式,一个grid每次只会同时访问少量数据,因此它本身并不能执行任何的数据感知操作,

 Instead, all data-aware operations are performed on the server side and their results are shown in the grid.

而是所有的数据感知操作都是在服务器端,然后服务端的结果才在grid里暗显示。

 

This is a general overview of how data is sorted in a server mode. Assume that an end-user clicks a specific grid column header to sort records against this column. The grid

这是一个关于数据在服务器模式如何被排序的描述。假如终端用户点击grid的某一列头来对数据排序,

sends a query to a data store to sort data against a clicked column and to retrieve a specific data range. The returned records are then displayed on screen. Upon scrolling

这个grid会发送一个查询到数据源来对点击的列排序和接收特定范围的数据。返回的记录然后显示在屏幕上,

 records, a grid sends requests to a data store to retrieve subsequent data sorted against a clicked column.

接着滚动记录,grid发送请求到数据源来接收点击列后被排序过的数据子集。

There are two distinctive server modes that differ in the way a grid control interacts with a bound data source. These are: regular (synchronous) server mode and Instant

有两个显著不同的服务器模式,他们的不同点在于grid控件与绑定的数据源交互方面。这两个模式是:一般(同步)服务器模式和即时回馈模式(异步服务器模式)

 Feedback mode (asynchronous server mode).

In a regular (synchronous) server mode, after sending a request to a data source, a grid control waits until data is retrieved and doesn't respond to an end-user's actions. So

在同步服务器模式,数据源发送请求之后,gird不会响应终端用户的操作直到接收到数据。

the GUI freezes and doesn't allow a user to interact with the grid control and other controls in the same form. After appropriate data is retrieved from a data source, the control is unlocked.

所以图形页面被冻结并且不允许用户与grid或在同一个Form里的控件交互,直到从数据源接收到相应的数据后,控件才会解锁。

In Instant Feedback Mode, data is retrieved by a data source in the background thread. So, a grid control and application never freeze while a request for data is sent to a data

在即时回馈模式,从数据源接收数据是线程在后台运行。所以,当发送出个请示到数据源时grid和应用程序从不会被冻结。

 source. An end-user can interact with a grid control (sort and group data, scroll the grid, etc.), without any delay.

终端用户能无延迟地与grid控件交互(排序和分组数据,滚动grid等等)。

 

Server Mode

If you need to display a large amount of records in a GridControl or any grid lookup editor (GridLookUpEdit andSearchLookUpEdit), you can use server data-binding modes. These are specifically designed to work with large datasets consisting of more than 50,000 records (the specific amount of data depends on your circumstances).

The main feature of server data binding modes is that data-related operations are performed on the server side, while in regular data binding modes, these operations are performed on the client side (by grid controls or grid lookup editors).

In server modes, even if a bound control is connected to a data store containing one million records, the initial data will be displayed immediately, and subsequent data will be loaded rapidly on scrolling. The secrets of this are 1) loading records in small portions, and 2) performing data-aware operations on the server side. This ensures quick response and improved performance for large data sources.

As in regular data-binding modes, in server modes, bound controls allow data to be edited, sorted, grouped and filtered. All the features supported in server modes are described inGrid Features Supported in Server Mode. To learn about the limitations of server modes, seeServer Mode Limitations.

Regular Server Mode and Instant Feedback Mode
服务器模式
如果你要在GridControl或任何grid lookup editor里显示大量数据,你可以使用服务器数据绑定模式,这种模式是特别设计来处理超过50000行以上的大型数据集(数据理根据你自己情况而定)。
服务器数据绑定模式的主要特点是数据相关操作是在服务器端执行,当在一般数据数据绑定模式,这些操作是在客户端执行(由grid控件或grid lookup editors)。
在服务器模式,即使绑定的控件连接到包含100万行记录的数据源,初始化的数据会立刻显示,然后子集数据会快速被载入当grid滚动去看其他数据。这有两个秘密:第一点是
载入一小部分数据,第二点是数据感知操作是在服务器端执行。这样能确保大型数据源的快速响应和性能的提交。正如控件在一般绑定模式的数据操作,在务器模式时的数据操作也是有的。请看Grid Features Supported in Server了解所有服务器模式支持的特点。关于服务器模式的限制,请看Server Mode Limitation.
 

In server modes, a data-aware control sends requests to a bound data source to retrieve appropriate portions of data when required. There are two distinct server modes that differ in the way controls interact with bound data sources.

  • Regular Server Mode (or synchronous server mode)

    In a regular server mode, the control, after sending a request, always waits until the bound data source returns data. Therefore, the GUI may freeze momentarily, and may not respond to an end-user's actions until data is retrieved.

  • Instant Feedback Mode (or asynchronous server mode)

    After sending a request to a data source, a control doesn't wait, doesn't freeze the GUI, and continues responding to user actions. Thus, users are able to work with the control (e.g. sort, filter and group data, resize columns, etc.) and other controls on the form, while data is being retrieved in a background thread.

    NoteNote

    Instant Feedback Mode is supported by the GridControl and SearchLookUpEdit controls. The GridLookUpEdit does not support this binding mode.

Server Mode Data Sources

To enable a specific server mode for your data-aware control, you need to use an appropriate data source. You can use data sources provided by the eXpress Persistent Objects (XPO) library, or use dedicated data sources tailored to work with 'LINQ to SQL Classes'. Thus, choose one of the following data sources for your control.

Data Access TechnologyServer Mode Data SourceInstant Feedback UI Data Source
Entity Framework 4EntityServerModeSourceEntityInstantFeedbackSource
eXpress Persistent ObjectsXPServerCollectionSourceXPInstantFeedbackSource
LINQ to SQLLinqServerModeSourceLinqInstantFeedbackSource
Parallel LINQ to ObjectsPLinqServerModeSourcePLinqInstantFeedbackSource
WCF Data ServicesWcfServerModeSourceWcfInstantFeedbackSource

 

上面表是给我们选择合适的数据源给数据感知控件。

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值