这个行为在DI世界中称作构造函数注入,因为实例是通过一个构造函数传递的。
This behavior is referred to in the DI world as constructor injection, because the instance is passed through one of the constructors.
构造函数注入利用构造函数判断要返回的具体对象类型。
Constructor injection USES a constructor to determine what type of concrete object to return.
应用推荐