1
votes

I have a silverlight application and uses wcf ria services. The question is about the options to host the wcf ria services.

In all the articles I read says, the RIA services should be hosted on the same web application where the silverlight app is hosted.

An alternative is , we can use WCF RIA class library, but still this need to be referenced in the silverlight web app where the silverlight is hosted.

I am wondering , for a cleaner implementation , can I host the WCF RIA services in any other web apps?

1
Since no answers yet, maybe I have to explain a little further. Usually, when we implement service layer with WCF services, we prefer to have a separate layer ( a WCF service project ) rather than hosting in the silverlight host website . This gives us a more decoupled, maintainable system. Is this approach possible with WCF RIA ? Thanks in advance!Jaleel
An related advice of more importance in my opinion: use a ria client library, ie. don't attach the silverlight client to the domain service directly. Clients that have the domain client code auto-generated into themselves directly suffer from a severe performace degradation of the xaml designer. I know that this sounds strange, but it's true.John

1 Answers

1
votes

The default scenario for WCF RIA Services assumes that you will create your business objects to be shared between the server and the client within your web project, and these will be replicated within your Silverlight project.

However, this scenario doesn't create an ideal separate “middle tier” where your business objects are contained within a separate assembly that can then be reused between applications.

This is where the WCF RIA Services Class Library project template comes in. It is possible, however, to move the business logic out of the Web project and into a separate class library, using the WCF RIA Services Class Library project template. So you can have your entities and metadata classes in a separate project from your server project. But you must add a reference to it in your web project where the silverlight is hosted.

This is a reasonable thing