温莎城堡适合在哪里?
我正在尝试使用 nHibernate、Castle Windsor、WCF 和 ASP .NET 为基于分布式域驱动设计的系统绘制技术架构图
我使用了典型的层,即基础设施层、接口层、应用程序层和域层
我的理解是否正确根据 DDD 将 nHibernate、Castle Windsor、WCF 分组为基础设施层的一部分?
请指教。
I'm trying to draw up a Technical Architecture Diagram for a Distributed Domain Driven Design based system using nHibernate, Castle Windsor, WCF, and ASP .NET
I used the typical layers i.e. Infrastructure, Interfaces, Application and Domain layers
Is my understanding correct to group nHibernate, Castle Windsor, WCF as part of Infrastructure layer as per DDD?
Please advise.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你的说法是正确的,nHibernate、温莎城堡、WCF 应该位于基础设施层。
实际上它们的用法有所不同。
WCF 通常放置在单独的程序集/项目中,因此可以将其视为底层,因为我们将其从表示、服务和域程序集/项目中移出。
Nhibernate 通常仅在 data/infra 程序集中引用,但某些 Nhibernate 模式还使用 Global.asax 或 CustomHttpModule 为每个 Web 请求配置 Nhibernate 会话。这可能很方便,但也需要额外的参考。
另一方面,城堡在所有层中都很有用。可以轻松地使用静态包装器来删除许多 Castle 引用,或者查看 Microsoft Practices 团队的 Common Service Locator。它还可以帮助解耦特定的 DI 工具的依赖关系。
I think your correct in your statement that nHibernate, Castle Windsor, WCF should be in a infrastructure layer.
In reality their usage differs.
WCF are often placed in a separate assembly/project and can therefore be seen as infralayer since we move it out from presentation, service and domain assemlies/projects.
Nhibernate are often only referenced in data/infra assembly, but some Nhibernate patters also uses Global.asax or a CustomHttpModule to configure Nhibernate session for each web request. This can be handy but also require extra references.
Castle on the otherhand can be useful in all layers. A static wrapper can easily be done to remove many Castle references or take a look at the Microsoft Practices team's Common Service Locator. It can also help in decouple dependencies so a specific DI tool.