创建WCF RIA DomainService的最佳实践

发布于 2024-10-07 21:39:51 字数 348 浏览 0 评论 0原文

我创建了Silverlight WCF RIA应用程序,该应用程序有4个子功能,A,B,C和D。它们都可以单独操作,也就是说功能A与功能B没有依赖关系,功能B没有依赖关系与 function-C 的依赖关系等等。

我决定按功能单独创建DomainService,DomainService_A用于CRUD和其他与A相关的功能,DomainService_B用于CRUD和其他与B相关的功能。

我认为按功能相关单独创建DomainService更适合进行代码管理,并且更容易维持,但我不知道其他因素,尤其是性能。我想知道,按功能相关单独创建DomainService和为应用程序中的所有功能创建一个DomainService之间有什么区别,哪一个更好?

I have create Silverlight WCF RIA application, this application has 4 sub-functions, A, B, C and D. All of them can operate 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽容 2024-10-14 21:39:51

我认为没有任何性能问题。然而,如果你按照这个思路,你显然可以发现某些场合有数百个域服务,这些服务正在杀死服务器端的某些缓存机制或其他东西。

你所说的功能是什么意思?充当工作单元?还是像方法调用中那样起作用?您是否有一个 silverlight 客户端,您可以在其中做出业务决策?也许这会导致许多方法调用回服务器。相比之下,您可以在服务器中做出业务决策,在服务器中您只能使用少量的方法调用。

从我的角度来看,域服务分离是一个设计问题。例如,如果您有一个 ORM,您可以将您的域划分为与业务对象相同的域服务。

设计 LoB 应用程序时需要考虑很多事情。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文