Best practice for create WCF RIA DomainService
I have create Silverlight WCF RIA application, this application has 4 sub-functions, A, B, C and D. All of them can op开发者_C百科erate separately, that being said function-A has no dependency with function-B, function-B has no dependency with function-C and so on.
I decide to create DomainService separate by function, DomainService_A for CRUD and other function that related to A, DomainService_B for CRUD and other functions that related to B.
I think that create DomainService separate by function-related is better for doing code management and it's easier to maintain but I have no idea about other factors, especially performance. I want to know, are there any differences between create DomainService separate by function-related and create one DomainService for all function in application and which one is better?
I don't think there is any performance concern. If you take this train of thought however, you can obviously find some occasions with hundreds of domain services, which are killing some caching mechanism server side or something else.
What do you mean by function? Function as a Unit of Work? Or function as in method call? Do you have a silverlight client in which you take business decisions there? Maybe this results in many method calls back to server. In contrast you can take business decisions in server, in which you could only use a small number of method calls.
The domain service separation is a matter of design from my point of view. If you have an ORM for example, you could divide your domain in equal domain services to your business objects.
There are many things to consider when designing LoB applications.
精彩评论