Imagine this scenario :
- You've built a Silverlight application with the out-of-browser feature.
- This application is installed on multiple computers.
- You may work with your Silverlight app without being connected.
- You want to avoid complex sync programming and you don't want to use server-side data service(s).
In this scenario, you need to work with a local repository to persist your data. Keep it simple and let's consider an XML file to serialize your data (for more complex scenario, this article may be a source of inspiration).
But… Implementing a data sync pattern may lead to headache.
How to avoid writing a server sync service, a (proprietary?) client agent (with a nice data changes detection), and how to remain the less system-dependant as possible?
Others have done it for you with Dropbox!
Simply said, Dropbox "is software that syncs your files online and across your computers".
Dropbox is stable, secure and very seamless. It works on Windows, Mac and Linux.
For more information about it and if you want to register, go here (and, at your turn, invite your friends to earn more space).
So, come back to our Silverlight OOB application. Here is then my architecture suggestion:
You can try it with this application : DropboxSLOOB
To use it :
Install the application on your computer (out-of-browser with elevated privileges) clicking the button
- Your Dropbox folder MUST be installed in your "My Documents" folder.
Create a small XML file in your Dropbox folder, copy this :
<?xml
version="1.0"
encoding="utf-8"?>
<Items>
<Item
data="This is an item data" />
<Item
data="This is another item data" />
<Item
data="efefe" />
</Items>
Now you can get your items and create new ones. And if you try to use another computer with the same application, you'll see that your data is synced!
To download this test application and the test XML file (it's inside the Visual Studio project), go here.
This application is made under VS 2010 RC with SL 4.0 RC.