软件开发进阶

依赖注入

English: dependency injection

读法: dih-PEN-dun-see in-JEK-shun (dependency injection)

释义

从外部传入类所需的对象,而不是在内部创建。

依赖注入让我们可以在测试中替换邮件发送器。
Dependency injection lets us swap the mailer in tests.

又称: DI

用单词卡学习 本分类的所有词汇

其他语言

反馈