Silverlight can use WCF, Web Services, REST based services, .NET RIA Services, but it seems like Silverlight and .NET RIA Services are preferred most.
I want to know if there are any common issues [which can be a show stopper if one goes ahead with this combo] that you have seen in practical implementation of SL with .NET RIA Services.
Thanks, Rahul
I am really disappointed about MS. As it is obvious from the discussion about this topic, I am not the only one who sometimes gets confused by all the "tools" we are provided by MS. The problem is that really miss some managing and coordination from MS.
The result is that there are very similar products with similar functionality where one does one thing better and the other another one. And no one can tell which one is better to use or even which one will be supported in the next version.
I have two examples.
Entity Framework vs. Linq to SQL in .net 3.5 These were very similar, both did the same. L2S was meant to be better for smaller projects, EF for enterprise ones. L2S had much better designer and better LINQ implementation. EF was supposed to be able to map more database tables to one entity but this never worked really well. And, by the way, even EF4 does not have a very useful feature of L2S that is AssociateWith<> function. And suddenly, L2S is no longer supported and everyone should use EF. There should be someone who at the very beginning said "Stop, we have two similar technologies. Let get the two teams together and make one product with the best of both.".
RIA services vs. WCF Data services Again, the same problem. Two distinct teams working on two similar products. Both with some better features tham the other. But definitely, there could be one product with the features of both.
How should we decide which one to use (besides spending a lot of time to mastering both)? Which one will be deprecated?
...this is probably for a blog post, not answer here. Sorry, I just needed to write it somewhere and since there was a lot of talk about these issues, it seemed as a proper place. I will definitely try to blog about it later.
I've been using RIA-Services for a few months and a couple of differen apps and found that I can get it to do pretty much everything I need. It saves you a LOT of time by using clever code-generation to take care of a lot of the plumbing.
It is best used if you're creating a straight forward CRUD application using EF, if that is the case then you should be fine.
If you're doing something a little different then it take a little bit more work but it still is (in my opinion) the best option for getting data to your silverlight client. There are some small annoyances but no show stoppers that I've found.
For example, I've used it with SQL Credentials (user logs into Silverlight app using their SQL login and I dynamically create connection string using the username + password). This took a little bit more work but it works fine.
I've also used it to return data to the client from Stored Procedures rather than from Entities, again this takes a bit more work but it works fine.
Ria services and rest services offers a quite similar access to server side classes that often are entity framework classes(but not necessarely...as several programmers appears to belive). The main advantage of Ria Services is that they handles Validation by using Data Annotations on server-side classes and do it in a smart way: they automatically generate client side-classes with the same data-annotations and validate them by implementing automatically INotifyDataError on the client-side class. If one uses custom attributes and put the.shared.cs (or .vb) extension those attribute definitions are copied in the silverlight client and used in the client-side validation, otherwise they are used only to perform server-side validation......for more information pls see my blog post
here
Ria services are created just to be used with Silverlight. They are substantially a standard "package" ready to be used by Silverlight. The advantage is that you have a lot of services without need to write code i.e.:
All things done by Ria can be done with WCF and with other available software and in particular with Wcf data services. For instance for data annotations I found this library that do a better job than Ria services, support for membership just require activating the already existing membership endpoint of a WCF service, and finally the exception problem is easily resolved by writing a WCF behaviour. Code is available here:http://www.silverlightshow.net/Storage/10Tips.zip The point is that with Ria Service you have all this in a mouse click!. On the other side Ria Services are really difficult to customize...so if you don't like the standard solution they offer you simply can't use them
I have been using SL4 + EF for our enterprise development and I found it, it is hard to develop with EF if you go with the default out of box development model. What I mean by that is, any screen you develop, for the data you use EF with a table/view then very quickly the your model get blotted. After adding 20 new pages with 6 to 10 tables/views now it is very difficult to add entities in the edmx. I personally do not like the blotting. If you see some of the questions I have asked and based on the answers it seems for enterprise level development do not use stright out of the box EF features instead, create a domain model using POCO with PI and then use that to develop your application. I have not completed one successfully yet so I do not have personal result on this. One another thing, I noticed it is not related EF per se instead SL itself. Spend some time and understand either PRISM/MEF/Caliburn and use that create your application. One of the problem I do not like in SL is testability, even though SL unit testing is there, it itself is not a good unit testing framework. Also testing EF is not breeze either. With PRISM/MEF/Caliburn not only testing is easy and also your development will be truly modular. So before you start your development, my recommendation is to look at one of the framework and instead of using EF outof box, use POCO to create your domain model and then use POCO to use it in SL. Hope this helps.
I have written a post in my Blog about Ria WCF Data Services, and WCF Rest Service using also some of the conclusions reached here it is here.