views:

38

answers:

1

Currently I have a working Silverlight application that uses .Net RIA Services.

It's structure:

Client-side

  • Application.Client.UI.dll (Xamls and basic UI stuff)
  • Application.Client.BL.dll (Contains the Link to RIA and most of the business logic)

Server-side

  • Application.Server.Data.dll (Server-side dll that holds the Entity-model and it's generated domain service)
  • Application.Server.Web.dll (Only the ASP.net hosting container, which references the Application.Server.Data.dll)

I placed most of the business logic on the client side (Application.Client.BL.dll) for better user-experience (fast reactions) and to free up server resources. My challenge is now to re-use this client-side dll including it's RIA data access capabilities, in a server-side windows service. I'm wondering, is that possible at all? Is the Application.Client.BL.dll still able to consume the existing RIA service, or does that dll require the Silverlight runtime to identify/locate it's service target, and therefore will not work anywhere else.

Curious for your answers

A: 

You really shouldn't put any business logic on the client, the guys in security and / or architecture will hate you for it ;-). Furthermore you can't use Silverlight assemblies in ASP.Net or Desktop projects and vice versa. If memory serves correctly, Silverlight uses an entirely different CLR altogether.

Dänu
Well it's just how you define business logic, only basic business logic is applied at client-side, the heavy business that uses database queries etc is still at the server side. The result is returned to the client.Furthermore it is in fact possible to run a Silverlight dll at both client and server side (in my case a message parser), the only thing NOT working is accessing the RIA data-access layer. Which throws an error... since the RIA client components do not seem to work server-side.
Remco