"Dependency Injection Container" 和 "Inversion of Control Container" 是一回事吗?

Are "Dependency Injection Container" and "Inversion of Control Container" one and the same thing?

我在许多文章中读到有关依赖注入容器的文章,还有许多其他人谈论 IoC 容器。虽然肯定有一些地方提到了两者,但我还没有遇到过。那么问题来了:这两者之间是什么关系?它们是一样的吗?还是一个是另一个的实现?或者……?

我会说它们是指代同一事物的两个不同短语,我会冒昧地建议“IOC 容器”可能是两者中更惯用/更广泛使用的。

I more often hear the phrase "Dependency Injection Framework"* as opposed to "container" and I imagine that's what most people actually mean when they say "Dependency Injection Container" - bearing in mind that all DI Frameworks will have a "container" which is the object that holds type mappings and is the entry point for the work of resolving object graphs for injection at runtime.

例如,在 Ninject 依赖注入框架中,StandardKernel 是“容器”。

希望没有让您更加困惑:)

更新

*正如史蒂文所指出的,这里的术语“框架”确实可能不准确,而术语“库”可能更正确。无论如何,称它们为“IOC 容器”是不会出错的。