3

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?

Brad Tutterow
  • 7,487
  • 3
  • 33
  • 33
Robert Kozak
  • 2,043
  • 17
  • 33

2 Answers2

0

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
  • 12,136
  • 30
  • 85
  • 134
  • 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 May 11 '09 at 22:56
0

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
  • 4,365
  • 1
  • 32
  • 40
  • 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 May 12 '09 at 19:15
  • Correction..Doesn't generate any code at all on the client side. No SampleService.g.cs file – Robert Kozak May 12 '09 at 19:25
  • By the way, the was an update to RIA services yesterday. It might fix your problems. – vidalsasoon May 12 '09 at 20:10