views:

23

answers:

2

I am developing a desktop application that will need to collect data (from the user) and store it locally in a secure fashion. It will need to synchronize this data with a central database when an internet connection is available. The application is WPF and I would like to take advantage of the new data-binding features of WPF. I really want this application to be lightweight, and thus not having formal business objects, and just binding directly to the XML file. My issue with this however is security. I could see encrypting the XML files, is that a realistic option. Another reason I wanted to use XML is for interfacing with other applications (on the desktop), which for this type of application, happens a lot.

On the flip side, there is SQL Server Compact, but to use it, I would most likely want business objects to represent tables, and to interface with other applications I would need to spit the data out to XML anyways. Security would be easy, just add a password to the database.

What do you guys think? Is there something I'm not taking into consideration, have I given enough information about my problem domain?

+2  A: 

If you need some local storage without any fuss, you should definitely also look at SQLite.

It has great .NET support including support for Entity Framework, and is basically frictionless and needs no installing a server or anything like that (just include some DLL's in your application's deployment - xcopy or otherwise).

It also allows you to encrypt the entire database file (*.s3db) to protect its contents.

marc_s
No install? That would really help distribution. The users that we serve with this application have very strict group policies on their machines and one less thing to install would be great. I've spent a little time with SQLite, when I would looking at Google Gears. How does this compare to SQL Server Compact?
Dylan Vester
@Dylan Vester: ok, sorry - I mean no need to install a server or anything. Just include some DLL's in your xcopy deployment, and you're done.
marc_s
+1  A: 

I've just finished an application that does exactly this, i.e. local database with sync to remote (SQL2008). I spent a lot of time looking into this and finally settled on:

  • WPF
  • SQL Server CE
  • Entity Framework
  • Sync Framework ( -> SQL server 2008 using change tracking in my case)

I realise that you want something lightweight - but I have to say that Entity Framework & Bindings take most of the pain out of databinding and building the UI, so you can concentrate on the problem in hand rather than the technology.

I would use WCF to bind to external applications.

Richard Harrison
So did you bind directly to the objects? Did you have to write find methods for everything that you wanted to bind to? Also, for a similar application we were using Sync Framework, and because of the side of our datasets we had to drop it. How much data are you synchronizing?
Dylan Vester
What I mean "bind directly to the objects" is, did you have an N-Tiered setup?
Dylan Vester
Binding directly to the EF objects for a desktop application which is structured/layered rather than Tiered. Data synchronisation is low amounts of MB. Can't imagine that it would be easier to sync. using XML.
Richard Harrison
Have you looked into the Azure platform? This is also something I'm considering.
Dylan Vester
The next version will almost certainly be syncing with SQL Azure instead of SQL 2008 - I've just got to write the code. Initial impressions seem good; using SqlAzureDataSyncClient seems like a breeze, although I've not actually used it yet... see http://www.microsoft.com/downloads/details.aspx?FamilyID=BCE4AD61-5B76-4101-8311-E928E7250B9A
Richard Harrison