Currently I am designing casually connected (offline) solutions for both desktop applications and Windows Mobile.
Store and Forward
Part of the solution requires that requests can be submitted and queued for execution when the network (or the resource you’re being disconnected from) is available. This has traditionally been known as “Store and Forward”. These mechanisms can be seen in every day desktop applications such as Microsoft Outlook or in traditional enterprise products such as MSMQ.
As a product developer, customers have an expectation that the product works immediately, “out of the box”, with few dependencies and little configuration. The difficulty with using MSMQ is that it can be problematic to setup.
To address the simpler “Store and Forward” requirement, the Patterns and Practices team created the original “Smart Client Offline Application Block“. Recently I spent a great deal of time learning and converting this to .net 2.0, only to discover that it has been superceded (somewhat) by the “Disconnected Service Agent Application Block”.
Disconnected Service Agent Application Block
This is a nicer (in my opinion) implementation of the original OAB which is part of both the Smart Client Software Factory and the Mobile Smart Client Software Factory. It uses the latest version of the Enterprise Library and seems easier to use. Annoyingly the guidance and recipes provided only seem to work if you’re creating a CAB (Composite Application Block) application, but the Quickstarts make up for this.
It appeals to me as I can use the same solution in both desktop and mobile applications.
By default the application block is dependent on SQL Server CE. This may have licensing implications. Fortunately this is abstracted away behind the IRequestQueue interface, which isn’t too hard to implement. I’m not sure which way I personally will go yet.
Interestingly it has generic proxies to invoke both WCF and traditional Web Services, “Out of the Box”.
So how do I get it?
The Disconnected Service Agent Application Block is only available as part of the download of the Smart Client Software Factory. The main point of this software factory seems to be as a vehicle for CAB. (read about it’s future here) Interestingly DSAAB is independent of CAB. (That’s the way I may use it).
Currently it’s only downloadable on it’s own.
Orcas Sync Services
Visual Studio 2008 contains a sophisticated online/offline solution called “Sync Services”. Currently it seems to me this is only oriented toward database synchronization, which is a different solution to the one DSAAB covers. Take a look at Nick Randolph’s blog entries on this here.
The code of the libraries is quite simple regardless, so I think the solution will continue to work for a long time to come.
I’ll post some simple code samples of using DSAAB using VB in future posts.