database independent Silverlight application - possible?

500 Views Asked by At

I am developing my application in Silverlight with MVVM pattern support. Now I use Sql server 2008, but I am start thinking about in future use also Oracle and XML as storage for my data. I query with linq to sql.

It is pattern which I can use to completely automated and independent from database my application? Where I will only replace few parameters (for example in web.config) to change database, and I write code as little as possible in code behind... Maybe it's chance to connect and implement it in MVVM pattern ?

What do You think ? I work out that in some db i will force to write queries in other ways(which will double or even triple code), cause db have other data types..so it's good idea to create so much independent app?

1

There are 1 best solutions below

3
Reed Copsey On

If you use Entity Framework with RIA Services with Silverlight, you could potentially swap out your data layer to a different database provider very easily (provided it's one that supports ADO.NET Entity Framework).

Using MVVM is a good idea, but really unrelated to your database independence goal. It's more of a pattern for structuring your application as a whole (which I recommend understanding), but the database access is really all part of your model layer in Model-View-ViewModel, so this isn't going to "help" with this aspect.