views:

23

answers:

1

My silverlight + ASP.NET MVC application does the following:

1) Silverlight client sends request via HttpWebRequest.

2) ASP.NET MVC connects to a SQL Server database (stored procedure) and gets back XML data It then sends that raw xml to the client (no web services or WCF).

3) Silverlight client receives xml and deserializes it with XmlSerializer class.

4) Deserialized object is manipulated, then serialized and sent back to server.

5) ASP.NET MVC receives xml and directly sends it to Database (stored procedure) where it is shreded and saved to appropriate table(s).

Is this an acceptable architecture? What problem with this approach be? Also, with SL 3 there seems to be an option to use binary XML, however I don't see good information how to use it without WCF. I found WCF to be quite heavy, so deliberately avoid it. For me, ASP.NET MVC based RESTful architecture seems more appealing. The above description may not be RESTful, but I think quite close. Any thoughts are welcome.

A: 

I think WCF would actually simplify the scenario and open many options that maybe you don't need right now but could be useful in your future (for ex. if you decide to add another kind of client, or decide to implement some security mechanism).

The "Binary XML" binding works pretty well with Silverlight clients (I use it a lot) and greatly reduces the size of serialized objects. For this reason alone it could be worth it to use WCF.

(By the way WCF is included in the Framework, so the only thing you'll add is a bit of complexity in your code -but not that much really-)

Francesco De Vittori