views:

349

answers:

2

Where is the best place to put business rules in an RIA Silverlight application?

I thought the Domain Service would be a good spot except it seems to only share Data to the client tier. I don't think the ViewModel is a good idea since we should have Business Rules in the server tier.

In shared code? *.shared.cs?

Where do you put your business rules?

A: 

Have you tried extending the EF partial classes? Properties on the EF classes are available on both the client and the server. I'm not sure if this is the "right" way to do things though.

James Cadd
Yes I have looked at that. We are probably going with L2S because of the problems we had with EF. But I am looking for the "right" way.
Robert Kozak
A: 

For RIA Services, your business logic is supposed to be in the Domain Service.

Can you give an example on how this is a problem for you?

EDIT: Look at the section 3.3 of this doc: http://download.microsoft.com/download/F/B/8/FB8CA635-296B-487F-965C-8148F08B5319/riaservicesoverviewpreview.pdf

vidalsasoon
Well for one thing: [EnableClientAccess()] public class SampleService : DomainService { public string TestProperty { get; set; } }Doesn't generate any code on the client for this property.
Robert Kozak
Correction..Doesn't generate any code at all on the client side. No SampleService.g.cs file
Robert Kozak
By the way, the was an update to RIA services yesterday. It might fix your problems.
vidalsasoon

related questions