Wednesday, March 28, 2012

Pre Fetching Data - InitialData Control?

Are there any features in ASP.NET AJAX for pre-fetching data? I'm thinking of a feature that would prevent the app from frequently pinging the web server for data (i.e. auto complete, cascading drop down).

From what I can tell, at one point there was an "InitialData" control that was aimed at sending a chunk of data down with the first request. It seems however that this control has been pulled from both Beta2 and the Futures. Does anyone know the status of this control?

Thanks!

Here is a solution for pre-fetching data for your reference.
????At any point in an Ajaxian application's lifetime, the user has the option to perform a number of activities. At the very least, there are always two things the user could do in the next moment: (a) close the application (by quitting the browser or closing the application window/tab); (b) nothing. And of course, there are usually a multitude of application-specific activities that can occur at any time.

Some of these user activities will trigger a remote scripting call to the server before returning for browser-side processing, and the delay will usually be noticeable. That's unfortunate for usability, because responses should ideally feel as if they are instantaneous. The computer not being able to freeze time, the response will never really be instantaneous. But from a usability perspective, it should ideally give that impression. To provide results at a pace that is below the level of human consciousness, a typical guideline is that the application should respond in under 10 milliseconds. That's a hard ask when a trip to the server is required. Especially in a global context, where a trip to the sever and back might cost a second or more due to network overheads.

The obvious motivation for instantaneous feedback is throughput: the user can achieve more because they're not waiting as long for results. Actually, that's not such a major issue: what's a few seconds when you're working on a document for half-an-hour?

Often, the biggest downside of latency is the distraction it causes. The user is focused on a task, and may well be in a state of "flow". A delay will cause a loss of concentration and, in addition to the time it takes to get back to this train of mind, there's also a risk that an idea might be lost forever.

Another problem is simply user frustration. Users generally like to feel in control of a system, so it's not ideal when the system causes delays, especially unpredictable delays.

A final issue with latency is its effect on responsivenes. When users are making decisions in real-time, they need real-time data. For an application such as financial trading, even a consistent 100-millisecond lead can make a big impact on overall performance.

Pre-fetching attempts to remove the delay altogether for certain user actions. It's usually infeasible to pre-fetch results for all actions, so the designer must be judicious in anticipating actions. We are especially interested in actions which are likely to be performed, so that the probability of no response is high. Furthermore, even unlikely actions may also be worth pre-fetching for, if they are critical to the application. Imagine an emergency response system, where the choices are "View your preferences", "Work on reports", and "Dispatch emergency units". The last of these might not occur very often, but which one would you like to be prefetched?

Another downside of pre-fetching is erratic behaviour. A good usability principle is consistent behaviour, but with Predictive Fetch, the user may be surpised that some commands respond instantaneously, while virtually identical commands take a long time. To make the waiting time more comfortable, consider showing a Progress Inidicator.
Advanced Networking Scenarios Not Available in the RTM Release
The following networking features of the CTP release willnot be available in the RTM release:
?The iframe executor. This feature provided support for cross-domain calls, and is not available in RTM release in part because of security concerns.
?The following infrequently used features:
oAssembly-based method calls.
oInitialData control.
oBatching of Web service calls.

No comments:

Post a Comment