Skip to main content
Home Forums Silverlight Programming WCF RIA Services Pattern of development with. NET Ria Service
6 replies. Latest Post by Klinger on July 24, 2009.
(0)
amarante...
Member
1 points
24 Posts
07-24-2009 9:45 AM |
Klinger
Participant
1686 points
300 Posts
07-24-2009 9:54 AM |
Amarante,
Take a look at the following answer:
http://silverlight.net/forums/t/112345.aspx
As you said, one ds per page does not work anymore.
I am using one domain service per application using partial classes to organize methods.
ColinBlair
Contributor
6579 points
1,291 Posts
07-24-2009 9:57 AM |
Generally, it is one DomainService per application/module. If you want to reuse code you need to either use the same DomainService or write your code against an interface and attach that interface to multiple DomainServices. I don't think DomainService per entity is a good design choice, it really keeps you from fully utilizing the full power of RIA Services.
Also, I think if you get stuck on a specific design problem (i.e. I have TableA and TableB and I need to use them in X way in this screen and Y way in screen2) those kinds of questions tend to get answered really quickly on this forum so don't hesitate to ask.
07-24-2009 10:05 AM |
Klinger,
07-24-2009 10:24 AM |
I believe the main decision factor in how to break down your tables in domain services (if you decide to do that) is
transaction support.
Correct me if I am wrong but the way Ria works right now, it's all but impossible to have a transaction envolving tables
from multiple domain services.
07-24-2009 10:50 AM |
It isn't impossible, but it is complicated and probably not a good idea. As the overview says in 5.7, RIA Services itself doesn't do transactions, that is left up to the data model. If you can cache your server side data model somewhere then you could probably pull it off but if the save fails for some reason you will probably need to completely reset the client side contexts as they will be about of synch.
07-24-2009 11:37 AM |
OK, impossible is a strong word. It's like never say never.
Like Colin said, it would be very complicated.
It would be great if in the future RIA could allow multiple submit changes as one.