Smart Client Offline Application Block
It appears that Microsoft has published the Smart Client Offline Application Block, even though the Patterns and Practices Group says it is “Coming Soon“. The block itself is available for download here.
This page provides an overview of the Offline Application Block, which is intended to serve as an architectural model for developers who want to add offline capabilities to their smart client applications. The block demonstrates how to:
- Detect the presence or absence of network connectivity.
- Cache the required data so that the application can continue to function even when the network connection is not available.
- Synchronize the client application state and/or data with the server when the network connection becomes available.
The block has various pieces, but the essential subsystems are:
Connection State Management - a mechanism that determines when the user is connected to the network or not, as well as a mechanism for the user to specifically direct the system to be online or offline.
Service Agent Management - a registry of Application Service Agents, which are classes that broker service requests which may be fulfilled remotely when online or locally when disconnected. A ServiceAgent class performs any tasks locally, within the block. These tasks can include creating and queuing the Payload, updating the local cache or retrieving all the data necessary to satisfy the request from the local cache. When designing a new offline block, developers should derive a new Application Service Agent class from the ServiceAgent class provided by the Offline Application Block.
Message Data Management - manages transactional data stored in a queue and provides infrastructure for adding the capability to synchronize data to the server. Included in the block is a defined interface IQueueStorageProvider, and four providers that implement this interface: InMemoryQueueStorageProvider for storing queued messages in memory only, IsolatedStorageQueueStorageProvider that persists messages in Isolated Storage, MSDEQueueStorageProvider, which stores queued messages in an instance of MSDE (or SQL Server), and MSMQQueueStorageProvider, which uses Message Queuing for storing messages.
Reference Data Management - a subsystem which provides reference data to the application even while offline. This system includes classes that represent the reference data cache itself, as well as classes to load/refresh the reference data when connected, and persist changes to Ref Data that can be made in the client.
This looks like a pretty good block, judging by the documentation at least. I haven't cracked the code yet.