代码改变世界

Inversion of Control Containers and the Dependency Injection pattern 之读书笔记二

2012-06-29 15:35 by Lance Ma, 147 阅读, 0 推荐, 收藏, 编辑
摘要:Forms of Dependency InjectionThere are three main styles of dependency injection. The names I'm using for them are Constructor Injection, Setter Injection, and Interface Injection.三种依赖注入:Constructor Injection, Setter Injection, and Interface Injection.其实,这三种都是大同小异。何出此言?其实都是“接口”注入。这里接口加了引号,是为了区分J 阅读全文

Inversion of Control Containers and the Dependency Injection pattern 之读书笔记一

2012-06-27 14:50 by Lance Ma, 286 阅读, 0 推荐, 收藏, 编辑
摘要:今天,读了马丁福勒的一篇文章题目是:Inversion of Control Containers and the Dependency Injection pattern。有了一些自己的理解,所以记在这里。第一点: Components and ServicesI use component to mean a glob of software that's intended to be used, without change, by an application that is out of the control of the writers of the component. 阅读全文