摘要
轻量级容器的解耦模式被称为“控制反转”或者“依赖注入”,组件之间的依赖关系由容器(运行环境)在运行期决定,从而在相当程度上降低了组件之间的耦合。该文详细论述了这种解耦模式的原理,以及依赖注入的3种主要形式,并且对几种形式进行了对比总结。
The decoupled module of lightweight containers is called" inversion of control" or"dependency injection pattern". The dependency of oomponents is decided at runtime by the container(runtime environment). So the coupling of components is relieved to a great extent. The paper first expatiates the theorem of the decoupled module, then describes three main styles of dependency injection. Besides, the paper compares and summarizes these styles.
出处
《计算机技术与发展》
2006年第11期59-61,共3页
Computer Technology and Development
关键词
轻量级容器
控制反转
依赖注入
lightweight containers
invertion of control
dependency injection pattern