R – Silverlight ASP.NET MVC RESTful approach

asp.netasp.net-mvcrestsilverlightxml

I use Silverlight 3 with ASP.NET MVC. For database operations I query SQL Server database using FOR XML, and send the data as XML over wire to Silverlight client where it is deserialized to business object. Is this approach good? I do not find much resource on Internet about using Silverlight, ASP.NET and XML together.

Best Answer

Why not use a SOA approach? I'll first tell you my approach then a link under that for a direct ASP.NET MVC approach. My approach is only because I need to expose a web service to other devices.

I have a WCF library which acts as the DAL and some Business Logic. I then have my asp.net reference this dll. Nothing in the Model's folder. So the ASP.NET works the same.

For the silverlight, I use a service reference to the wcf service. Some features which uses the same data as the asp.net does, calls into the ASP.NET controller that is specified as how Tim Huer did it here.