工厂类和抽象工厂类能够被用做依赖框架,但是已经有了专门的框架,被称为反转控制容器。
Factories and Abstract Factories can be used as dependency frameworks, but there are specialized frameworks for that, known as Inversion of Control Container.
NK:控制反转仅仅是一种思想,各种依赖注入(无论有无框架)都取决你设计的软件是否抱有控制反转的目的。
NK: inversion of control is a mindset, and dependency injection of any kind (with or without a framework) relies on your software being designed with the goals of inversion of control in mind.
软件具有的控制反转反模式越多,那么使用Ninject对代码进行优化就越困难——应该说任何一种依赖注入技术对于这种情况都难以应对。
The more of these inversion-of-control anti-patterns the software has, the more difficult it will be to reshape it to work with Ninject -- or any dependency injection technique, for that matter.
应用推荐