【发布时间】:2014-04-02 05:14:57
【问题描述】:
最近,当我在我正在进行的项目中尝试使用 Ninject 时,我遇到了障碍。
我经历了各种各样的问题,系统地要求我的设计和架构支持依赖注入。
Is this right to inject the container/kernel to the main application presenter?
How to configure Ninject to use along with NHibernate in WinForms?
Conditional dependency injection binding only when property not null
What did I get wrong, DI or Design, and how should I go about it?
经过数小时、数小时、数小时的搜索,我看到了 Justin Etheredge 的那篇文章,他谈到了他的静态 DIFactory 类。
我现在想知道,使用静态 DI 工厂不是让事情像魔术一样工作吗?
我想了解在实际应用程序中使用静态 DI 工厂的优缺点。
另外,IoC 和 DI 是否相同,或者它们非常相似,但存在一些差异?
【问题讨论】:
标签: c# architecture dependency-injection inversion-of-control