Skip to main content

Microsoft Silverlight

Answered Question Pattern of development with. NET Ria ServiceRSS Feed

(0)

amarante.thiago
amarante...

Member

Member

1 points

24 Posts

Pattern of development with. NET Ria Service

I wonder if anyone has a suggestion of standard to be adopted in developing applications with. NET Ria Service.
 
In the initial version of Ria Service, I worked with the concept of a DomainService per page, so I put all the logic in the service and made available to all entities that would be needed and methods as well.
 
With the new version. NET Ria Service (July) it will not let me work more with the exhibition of the same entity in different DomainService, which makes the pattern that I worked.
 
The concept now is a DomainService per entity?
Or could be a DomainService for any application?
Do you have any suggestions?

thanks

Klinger
Klinger

Participant

Participant

1686 points

300 Posts

Re: Pattern of development with. NET Ria Service

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
ColinBlair

Contributor

Contributor

6579 points

1,291 Posts

Re: Pattern of development with. NET Ria Service

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.

-Colin Blair

http://www.RiaServicesBlog.net : The Elephant Guide to RIA Services
SLColinBlair on Twitter

amarante.thiago
amarante...

Member

Member

1 points

24 Posts

Re: Pattern of development with. NET Ria Service

Klinger,

Actually one of the alternatives I found this was also working with a single DomainService by application. And organize the methods using partial class.

I be a good way of development.
If someone has a better suggestion, please suggest.

Klinger
Klinger

Participant

Participant

1686 points

300 Posts

Re: Pattern of development with. NET Ria Service

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.

ColinBlair
ColinBlair

Contributor

Contributor

6579 points

1,291 Posts

Answered Question

Re: Pattern of development with. NET Ria Service

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.

-Colin Blair

http://www.RiaServicesBlog.net : The Elephant Guide to RIA Services
SLColinBlair on Twitter

Klinger
Klinger

Participant

Participant

1686 points

300 Posts

Re: Pattern of development with. NET Ria Service

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.

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities