For instance, any class representing a non-empty container would naturally take arguments representing its elements in the constructor.
例如,表示非空容器的任何类在构造函数中必然使用表示其元素的参数。
Next, you see an example of constructor injection and how Geronimo's deployment plans define how the container injects code.
接下来,将看到构造函数注入的示例,以及Geronimo的部署计划定义容器注入代码的方式。
OpenEJB will also support constructor injection, which enables the container to provide various classes and objects at run time.
OpenEJB还将支持构造器注入,从而使得容器可以在运行时提供各种类和对象。
Unity is a lightweight, extensible dependency injection container with support for constructor, property, and method call injection.
Unity是一个轻量级,可扩展的依赖注入容器,支持构造函数,属性和方法调用注入。
HiveMind users typically prefer setter injection, but the container also supports constructor injection.
HiveMind用户通常优先选择setter注入,但该容器还支持构造函数注入。
When the constructor of the host is called, the host USES the parent service provider (IServiceProvider) to construct its service container.
当宿主的构造函数被调用时,该宿主使用父服务提供程序(IServiceProvider)来构建它的服务容器。
The container sees that the constructor requires an IAccountRepository and an ILogger, so it creates those (using the concrete types previously specified) and passes them to the constructor.
容器看到构造函数需要一个IAccountRepository和一个ILogger实例,因此它创建了那些对象(使用先前指定的特定类型)并通过构造函数传递给AccountTransfer实例。
The dependency will be injected through the constructor. You instantiate a container.
该依赖关系将通过构造函数被注入。
The site constructor takes the designer host and the component so that it can establish the component-container relationship shown in Figure 2.
站点构造函数采用设计器宿主和组件,以便可以建立图2中所示的组件-容器关系。
Is it considered poor DI practice to include your app container within the constructor of a service?
它被认为是穷邸实践包含你的应用容器内的服务构造函数?
Each class whose instance will go into the container must implement at least the copy constructor it is good to implement also the assignment operator.
每个类(其实例要在容器内使用)必须至少实现拷贝构造函数(实现赋值运算符,也是好习惯)。
Each class whose instance will go into the container must implement at least the copy constructor it is good to implement also the assignment operator.
每个类(其实例要在容器内使用)必须至少实现拷贝构造函数(实现赋值运算符,也是好习惯)。
应用推荐