您如何组织NInject模块? [英] How do you organise your NInject modules?
问题描述
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屋!