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
WCF RIA Service is a higher-level framework and a new component of frameworks like . NET 4 and Silverlight 4 that eases the procedure of building a complex business application in Silverlight by offering client-side validation. RIA stands for Rich Internet Applications.
The WCF RIA Services is a framework that provides a pattern to write application logic that runs on the mid-tier and controls access to data for queries, changes and custom.
Working with metadata (and writing it by yourself) is really pain in the ass. Especially when you need to update your model. RIA tutorial applications look quite well on a small database but working with a model consisting of dozens of entites, you'll spend more time updating metadata than programming the application itself. This is also connected with definition of validation and all the validation and description messages on properties from resources. But we have created some T4 templates so it all gets generated automatically.
On the other hand, we're using RIA on two projects and I must say it's the best we can get. We had some troubles with validation but it can be solved (validating before checking whether the property value has changed). And once you are aware of memory management with RIA (you don't want to load the whole databse into memory on client etc.), it can be used in real life.
Unfortunately, there is no silver bullet, so if you, for example, plan other clients than your SL app to connect to the server, you should probably watch somewhere else (WCP Data Services, maybe?). Or if you don't want to update data from your client, I see RIA as overkill.
FOLLOWING MY PREVIOUS ANSWER HERE THE DISADVANTAGES OF RIA SERVICES: On the other end the disadvantage of ria services is its lack of flexibility. Mainly it is like a tube that connect a class on the server side with its client side representative in such a way you operate on the client side class like you were operating directly on the server side class. If the way this "tube" his handled is ok for your application, you get a lot of services fro free (without writing any code...). However, there are limitations that one cannot remove specifically:
1) You have not the same freedom in defining behavior, attribute etc. to modify the way the Web service behaves. For instance you cannot define a distributed transaction involving more than one web service. It is difficult to add new endpoints....You have to write code....not simply modifying a configuration file.
2) You can only define one Insert/one update/one get methods for each class. If you apply filtering to the client side query via LINQ it is applied only on the client, i.e. all data are downloaded from server and then filtered on the client. On the contrary if you use a WCF data services based on OData and you define a query on the client side. THIS QUERY IS TRANSLATED INTO A REST QUERY (a query encoded in the URL of the request) THEREFORE ONLY THE DATA YOU REQUIRE WITH YOUR FILTER ARE ACTUALLY DOWNLOADED FROM THE SERVER. For more information on WCF data service see here.
3) By contrast with WCF Data Services you have no Validation service offered as with Ria service. However you can continue using data annotatios with the help of my Validation Toolkit for WPF & Silverlight, that is available for free here
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 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With