您如何组织NInject模块? [英] How do you organise your NInject modules?

查看:55
本文介绍了您如何组织NInject模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NInject的模块体系结构似乎很有用,但我担心它会变得一团糟.

NInject's module architecture seems useful but I'm worried that it is going to get in a bit of a mess.

您如何组织模块?您将它们保留在哪个组件中,以及如何确定哪个模块中的布线?

How do you organise your modules? Which assembly do you keep them in and how do you decide what wirings go in which module?

推荐答案

每个子系统都有一个模块.当然,应将哪些类别归类为子系统"的定义取决于...

Each subsystem gets a module. Of course the definition of what warrants categorisation as a 'subsystem' depends...

在某些情况下,由于较低级别的子系统/组件无法做出最终的权威决策,因此对某些绑定的责任被推到更高的级别-在某些情况下,这可以通过将参数传递给模块.

In some cases, responsibility for some bindings gets pushed up to a higher level as a lower-level subsystem/component is not in a position to make a final authoritative decision - in some cases this can be achieved by passing parameters into the Module.

这篇关于您如何组织NInject模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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