The title says it all. I went to a couple of sessions around WCF RIA Service (renamed because of the close relationship with WCF) sessions today and say the slight of hand behind the magic. Why do I say its magic? Well there is a lot code generation and attribute magic. Microsoft has built an extensible framework to allow developers to build middle tier logic that gets projected to the client. The magic is that there is no need to wire up connections from the client to the service.
All the demos I saw today emphasized the ease with which you can get data from the server to the client and back again. All in a secure manner. I say that because you can lock down access to methods by simply adding an attribute. Using the authentication and roll providers built into ASP.Net. This gives you the ability to secure based upon authenticated and or roll.
So how does the magic happen? Under the covers, RIA Services is creating all the client side model classes, all the web service calls, and maintaining change lists across the wire. Remember that Silverlight makes web calls asynchronously. RIA Services wires that up for you as well. Finally if you make changes on the client that need to be persisted back to the server, RIA Services maintains that for you too.
So you may be asking “Do I have to use Microsoft’s Data solutions (LINQ-To-SQL, Entity Framework…) to gain the benefits of RIA Services?” The answer is no. I saw a demo today written against a NHibernate implementation. It is suggested that you use Microsoft’s data solutions because there are providers all ready written for you. If you want to use other data technologies you have to write the provider yourself. That is a little more work but you gain all the glory that is RIA Services.
Can I only use this with a Silverlight as a front end? The answer is yes and no. Yes, if you want the code projection and the automatic communication wire-up. Microsoft plans to add functionality for AJAX.Net, ASP.Net and others. No in the sense that the server side is just WCF services that you could access and reference from other technologies. So you only get partial magic but you are positioned for when Microsoft provide magic for your technology. You could write you own magic if you wanted. They are using T4 code generation for the Silverlight projection.
RIA Services is a very powerful framework that allows us to rapidly develop Data heavy rich user experiences. There are bit currently available with a go-live license for .Net 3.5SP1. Visual Studio 2010 and .Net 4.0 has the version that will become V1 when the ship in early 2010.