31

关于依赖注入(typescript)

 5 years ago
source link: https://juejin.im/post/5c16004ae51d45485a098ef8
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
一、概念:依赖注入(DI)、控制反转(IOC)、IOC容器 依赖注入(DI)和控制反转(IOC)基本是一个意思,因为说起来谁都离不开谁。 简单来说,类A依赖类B,但A不控制B的创建和销毁,仅使用B,那么B的控制权则交给A之外处理,这叫控制反转(IOC)。 由于

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK