Spring supports three types of dependency injection — setter, constructor, and method injection — but overall, the prevailing model is setter injection.
Spring支持三种依赖注入——setter、构造函数和方法注入——但总的来说,最流行的模型是setter注入。
Dependency injection can occur in a variety of ways, for example, via a setter method or a class variable.
依赖性的引入可以以多种方式出现,例如,通过设置属性值的方法或者类变量。
Dependency injection can occur in a variety of ways, such as through a setter method or a class variable.
依赖项注入可以通过多种方式进行,例如通过setter方法或类变量。
Type 2 or setter injection, in which the dependent module exposes a setter method which the framework USES to inject the dependency.
类型2设置器注入,使用者暴露一个设置器方法,框架将使用此方法注入依赖项。
Type 2 or setter injection, in which the dependent module exposes a setter method which the framework USES to inject the dependency.
类型2设置器注入,使用者暴露一个设置器方法,框架将使用此方法注入依赖项。
应用推荐