views:

598

answers:

5

Hi everyone,

I have a legacy dot net application (now migrated to .net 2.0).

We need to convert this application to silverlight.

Problem here is the datalayer. All the methods from the datalayer return datasets. The entire web application is using datasets for databinding.

Now the questions are:

  1. Can I use the same datasets for silverlight pages also?
  2. Or do I have to create a wrapper around the datalayer?
  3. Or do I have to change the entire datalayer architecture (like returning collections etc)?

Please suggest the best possible way.

Thanks, SNA

A: 

If the goal of your conversion is to create a Silverlight version of your application with the least amount of change to your business logic layer, then a wrapper is your answer.

This is a lot of work in Silverlight V2, as you probably know. If you'd like some detail, here's a blog post. You will end up rolling your own serialize/deserialize/zip/encode layer for transferring the data to your Silverlight app.

Silverlight 3 isn't out yet, but close from the rumors. And this functionality is present in V3 (from what I hear).

BPerreault
thanks a lot for the answer
swapna
+1  A: 

Unfortunately, DataSets aren't supported in Silverlight 2 (and afaik aren't coming in Silverlight 3).

I'm going to assume that your current data layer has methods like GetTopCustomers that return DataSets, then the client application can modify that data and re-submit it to a data layer function like UpdateCustomers that takes a DataSet as a parameter and then submits changes to a database. If this is the case I think you'll have a tough time writing a wrapper because you'll be on your own for enforcing referential integrity and tracking changes on the client side. It's certainly possible but I think it'll be more pain than its worth. So imo creating a wrapper around your data layer would be equivalent to changing the entire data layer architecture to return collections, etc.

You best bet for a data layer is .NET RIA Services, which ships sometime in the Silverlight 3 timeframe. It's a huge leap over the current technology, ADO.NET Data Services, in that it adds change tracking and a DataSet-like "context" for the client. It also allows direct sharing of code between ASP.NET (or any part of the full .NET Framework) and Silverlight so your business rules can be run on both the client side and server side. Rewriting your data layer may not sound appealing, but I think it'll spare you much pain and you'll get a huge return if you choose .NET RIA Services. If that choice doesn't fit the other option is to use ADO.NET Data Services to ship the data back and forth (combined with a wrapper for your current data layer) or to write your own custom WCF services to provide CRUD operations (again with a wrapper on your current data layer).

Good luck!

James Cadd
According to Tim Heuer's blog, SL3 isn't released on July 10, but will be launched. http://timheuer.com/blog/archive/2009/06/05/verify-your-silverlight-application-compatibility.aspxSo don't count on this date.
BPerreault
thanks a lot its very useful info.
swapna
Good catch - edited the post to remove release information which could be wrong.
James Cadd
A: 

Hi david, Try to look at this: http://silverlightdataset.codeplex.com/ Ping me for additional information if needed at [email protected] Vitaly Laskarzhevsky

A: 

David, You should check out http://www.SilverlightDS.com they might provide the tools you need. Their support staff is pretty cool as well.

vince
A: 

Silverlight Dataset project was moved to http://silverlightdataset.net

Vitaly