撰写单页上界上下文 [英] Composing bounded context on single page

查看:116
本文介绍了撰写单页上界上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始大的项目,我想使用DDD。主要的问题是如何在不重复的数据和NH的映射显示来自多个界上下文数据。我看着乌迪的播客关于复合应用程序。他提到关于使用剃​​刀部分来自多个限界上下文中显示的数据,但他没有提供任何细节。有谁知道如何使用它,或者没有任何人知道其他的方式?

I'm starting large project and I want use DDD. The main problem is how to display data from multiple Bounded Context without duplicating data and mappings of NH. I watched Udi's podcast about composite application. He mention about using Razor sections to display data from multiple bounded contexts but he doesn't provide any details. Does anybody know how to use it or does anybody know other way?

推荐答案

在关于NH映射,每个界上下文(BC)应该有自己的一套映射,因此其自身的会话工厂。它可以是棘手配置DI容器,使得其可解决对于每个相应公元前相应会话工厂,因为会话工厂接口将必须标记到与特定的BC相关联,然后将该BC之内的所有依赖关系也将已经与该标签相关联。另一种选择是创建一个开放的主机服务(如REST)封装每个BC,然后从你的web应用程序引用服务。这样,您就不必担心您的Web应用程序管理NH映射。

In regards to NH mappings, each bounded context (BC) should have its own set of mappings and therefore its own session factory. It can be tricky to configure a DI container such that it resolves the appropriate session factory for each respective BC, because the session factory interface will have to be "tagged" to be associated with a particular BC and then all dependencies within that BC will also have to be associated with that tag. Another option is to create a open host service (such as REST) to encapsulate each BC and then reference the service from your web app. This way you don't have to worry about managing NH mappings in your web application.

这篇关于撰写单页上界上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆