views:

328

answers:

3

I'm currently designing a smart client app (WPF) which needs to operate in an "occasionally disconnected" mode. For the offline scenario, I'm looking at using:

  • Disconnected Service Agent Application Block (from the Smart Client Software Factory)
  • Microsoft Sync Framework

I should mention that I want my smart client app to be XCOPY-deployable, auto-updating, and installable without administrative privledges -- basically a ClickOnce-deployed app. From what I can tell this means the Microsoft Sync Framework is out because it has some COM in it's implementation that needs to get registered on the client which requires admin rights. Is it possible to XCOPY deploy and run MSF from a ClickOnce app? Any other ideas for data synchronization?

+1  A: 

From all I can tell, MSF requires an admin install -- which annoys the living daylights out of me as earlier versions of Sync for ADO.NET did not.

Jon
+1  A: 

Why would you use the Sync Framework? Is there a specific use case you have in mind where it would work well?

The DSA will stack up the service calls and once a connection becomes available it will start to shoot those calls off to the relevant services. It's not something you could really Sync.

What we've done in my last two Smart Client apps was a simple manual implementation for 'sync-ing' things like reference data. Anything that get's sync-ed does not through the DSA (sync logically only occurs in connected mode).

Client side for each 'piece' of data that needs sync-ing we store the datetime it was last synchronized. To sync we send the piece 'type' with the last updated time, then the server sends back the delta of new and updated items. Doesn't handle the case for deleted items but that generally makes it tricky.

In my current app we synchronize this data at startup of the app as this is sufficient but in my previous system we had a background thread running which would check every minute or so if each 'piece' needs to updated (eg every 24 hours for unimportant items, 1 hour for important ones) and asynchronously initiate the sync if required.

It's a little bit of extra work client and server side but honestly I believe it's less work than trying to get some external framework to do it for, especially if that framework cannot be deployed within your clickonce deployment package.

Making your app 'occassionally connected' hugely adds to the complexity of the system...so good luck!

wallismark
+1  A: 

Hi maybe a bit too late, but you could use the bootstrapper package. "...Sync Framework 2.0 bootstrapper package samples that can be used with Visual Studio Setup & Deployment projects and ClickOnce applications to redistribute Sync Framework 2.0 components..." (http://www.microsoft.com/downloads/details.aspx?familyid=109DB36E-CDD0-4514-9FB5-B77D9CEA37F6&displaylang=en)

Paul van Dam