Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ASP .NET Database Programming Weekend Crash Course - J. Butler, T. Caudill.pdf
Скачиваний:
31
Добавлен:
24.05.2014
Размер:
3.32 Mб
Скачать

Session 14—ASP.NET Caching

147

optional methods are illustrated below which shows storing a DataSet object for absolute expiration in 2 minutes, and giving it a high priority and slow decay so that it will have priority over other cached items should resources become constrained:

Cache.Insert(“DataSet”, oDA, Nothing, DateTime.Now.AddMinutes(2), TimeSpan.Zero, CacheItemPriority.High, CacheItemPriorityDecay.Slow, onRemove)

REVIEW

ASP.NET provides a much more robust caching model, than was previously available in ASP. This should allow you tremendous flexibility in designing and optimizing your application to the needs of your end users. The ability to store just about anything in cache including XML, files, and even objects as part of the data cache opens up nearly unlimited possibilities for you as a developer.

Tip

Remember that when you are storing items in cache, you are increasing the demands on available memory, so be sure to monitor your application servers for memory utilization as you expand the use of these features in your application framework.

QUIZ YOURSELF

1.When would you want to set SlidingCache to True in an application? (See “Sliding cache expiration.”)

2.Describe the differences between page output caching and data caching? (See “Page Output Caching” and “Page Data Caching.”)

3.Under what scenarios would data caching be useful? (See “Page Data Caching.”)

S E S S I O N

15

Introducing ADO.NET

Session Checklist

Understanding the core differences between ADO and ADO.NET

Knowing when to use ADO.NET

Understanding the benefits of ADO.NET for n-tier application development

In this session, we cover the major factors that are key to understanding ADO.NET and its usefulness for n-tier platform development. We take a brief tour of the history of ADO and then expand into why the move to n-tier application development has required

the delivery of an enhanced data access layer that more appropriately supports disconnected datasets and cross-platform sharing of data and schemas.

A Brief History of Microsoft Data Access

The days of homogenous operating environments are numbered. Most of today’s Internet applications are deployed in heterogeneous environments that consist of loosely coupled platforms. These new environments pose new challenges for sharing common services and system scalability. To address the requirements of these heterogeneous environments, Microsoft has developed ADO.NET.

There are three key requirements related to data access that have evolved in the expanded use of distributed computing:

Robust data exchange among heterogeneous computing environments.

Native support for the transmission of data sets across firewalls using HTTP.

Requirement to rapidly scale while supporting a centralized data store.

ADO.NET is an evolution of the ADO model for data access. ADO was an extremely effective, easy-to-use model that provided the ability to interact with multiple types of structured data. However, the core element of the ADO model, the RecordSet object, was