在复合应用程序中重用领域模型的最佳实践是什么?

发布于 2024-07-11 12:33:56 字数 373 浏览 7 评论 0原文

我们有一个使用复合 UI 应用程序块 (CAB)/智能客户端软件工厂 (SCSF) 构建的复合应用程序。 迄今为止,我们的复合应用程序中的每个模块都使用了自己的一组 DTO,并且业务逻辑已在整个模块中重复,包括 UI 层和服务层。 我想追求更多的域驱动方法,以便将业务逻辑封装在域层中,该域层可以分布到 UI 层和服务层,并且(理想情况下)跨模块。

我们的复合应用程序中同时开发了多个模块,并且我们需要能够以任何顺序部署它们。 理想情况下,我希望我们的模块共享一个公共域模型,但恐怕当我们与模块一起部署新版本的域模型时,我们将需要针对域模型对其他模块进行回归测试。

另一种选择似乎是在每个模块中复制域模型,但所有代码重复对我来说都很有趣。 业界是否针对此类情况制定了最佳实践?

We have a composite application built using the Composite UI Application Block (CAB)/Smart Client Software Factory (SCSF). To date, each module in our composite app has used its own set of DTO's, and business logic has been duplicated throughout the module, both in the UI layer and the Service layer. I would like to pursue more Domain-Driven approach in order to encapsulate business logic in a domain layer that can be distributed to the UI tier and the Service tier, and (ideally) across modules.

We have multiple modules in our composite application under development at one time, and we need to be able to deploy them in any order. Ideally, I would like for our modules to share a common domain model, but I'm afraid that when we deploy a new version of the domain model along with a module, that we will need to regression test the other modules against the domain model.

The alternative seems to be duplicating the domain model in each module, but all that code duplication smells funny to me. Has the industry developed any best practices for this type of situation?

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

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

发布评论

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

评论(1

番薯 2024-07-18 12:33:56

我使用了单一域模型,但该模型允许对每个单独的定义进行版本控制。 代码生成提供每个服务的接口以及可以跨服务和版本边界的映射代码。

I've used a single domain model, but one which allows versioning on every individual definition. Code generation provides both the interfaces per-service, and mapping code that can cross service and version boundaries.

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