CTP3 API Changes (Velocity)

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

There were significant changes made to the Microsoft project code named "Velocity" API for community technology preview 3 (CTP3). This topic provides an overview of the changes. The class library documentation lists the latest details. For more information, see Microsoft.Data.Caching.

Name Change Overview

The following table provides a summary of the name changes that occurred in the "Velocity" API between CTP3 and the previous release. A new class, enumeration, and delegates for the cache notifications API are also listed.

CTP2 CTP3 Notes

System.Data.Caching namespace

Microsoft.Data.Caching

The "Velocity" namespace changed, affecting the entire API.

Cache class

DataCache class

Name and member changes

CacheErrorCode class

DataCacheErrorCode enumeration

Name, type, and value changes

CacheException class

DataCacheException class

Name change

CacheFactory class

DataCacheFactory class

Name and constructor changes

CacheItem class

DataCacheItem class

Name change

CacheItemVersion class

DataCacheItemVersion class

Name change

LocalCacheSyncPolicy enumeration

DataCacheLocalCacheSyncPolicy enumeration

Name and value changes

LockHandle class

DataCacheLockHandle class

Name change

LogSink class

DataCacheLogSink class

Name change

ServerEndPoint class

DataCacheServerEndpoint class

Name change

SessionStoreProvider class

DataCacheSessionStoreProvider class

Name change

SinkType enumeration

DataCacheSinkType enumeration

Name change

Tag class

DataCacheTag class

Name change

(new class)

DataCacheNotificationDescriptor class

New class for distinguishing cache notifications. For more information, see Cache Notifications (Velocity).

(new enumeration)

DataCacheOperation enumeration

New enumeration for specifying cache operations that can trigger cache notifications. For more information, see Cache Notifications (Velocity).

(new delegate)

DataCacheNotificationCallback delegate

New delegate for cache notifications. For more information, see Cache Notifications (Velocity).

(new delegate)

DataCacheFailureNotificationCallback delegate

New delegate for failure notifications. For more information, see Cache Notifications (Velocity).

"Velocity" Namespace

The "Velocity" namespace has been changed to Microsoft.Data.Caching. This change affects all classes, delegates, and enumerations in the API.

DataCache Prefix

The names of all classes in the "Velocity" namespace have had the prefix DataCache added to their name. The DataCache prefix groups all "Velocity" classes together in the IntelliSense scroll window.

"Default" Property Changes

The Cache.DefaultCache and Cache.DefaultRegion static properties have been removed. Instead of using Cache.DefaultCache to retrieve the name of the default cache, use the GetDefaultCache method to return a reference to the default cache. Instead of using Cache.DefaultRegion to specify whether you want cache operations to occur inside or outside of regions, use the corresponding method overloads that include or do not include the region parameter.

Region Parameter

Throughout the API, the region parameter has been moved to the last parameter in most methods. With some methods in CTP2, the value you passed to the region parameter determined whether the cache operation was inside a region or outside a region. In CTP3, new overloads have been created so that you only use the region parameter when you want a cache operation to take place inside a region. This change affects the following methods most significantly: Add, Put, Get, Remove, Unlock, PutAndUnlock, and ResetObjectTimeout.

Tags Parameter

The tags parameter, used by many methods to specify one or more DataCacheTag objects, has been changed to a generic type. In CTP3, instead of passing an array of DataCacheTag objects, pass a list of DataCacheTag objects.

Region Methods

The methods used to access objects in regions have been replaced. Also, the CreateRegion and RemoveRegion methods no longer return a true or false value.

The CTP2 Cache methods: GetEnumerator, GetAllEnumerator, GetAnyEnumerator, GetByTag, GetAllMatchingTags, and GetAnyMatchingTag have been removed. In place of these methods, CTP3 provides a group of GetObjects methods that return the specified objects in an IEnumerable KeyValuePair. The new methods are GetObjectsByTag, GetObjectsByAnyTag, GetObjectsByAllTags, and GetObjectsInRegion.

Cache Notifications API

To enable the cache notifications feature, one class, two delegates, and several new methods have been added to the "Velocity" API. For information about how to use the cache notifications API, see Using Cache Notifications (Velocity).

See Also

Concepts

What's New for CTP3 (Velocity)

Other Resources

Cache Client API Overview (Velocity)