Is it considered poor DI practice to include your app container within the constructor of a service?
它被认为是穷邸实践包含你的应用容器内的服务构造函数?
In this case, the annotations are specified within the constructor parameters instead of above the field name.
在这种情况下,注解指定在构造器参数中,而不是放在字段名称上面。
Unless overridden for a specific object, this conversion happens within the constructor of the internal DocumentContext class.
除非针对特定对象重写,否则这种转变应在内部documentcontext类的构造函数中发生。
The catch clause can handle exceptions thrown either from within the member initialization list or from within the constructor body.
catch子句既可以处理从成员初始化列表中抛出的异常,也可以处理从构造函数函数体中抛出的异常。
The above constructor takes in the values of these namespaces and saves them within the class.
上面的构造函数接收这些名称空间的值并将其保存在类中。
The important point here is that the constructor form takes only one argument, so you have to enclose the object sequence within parentheses.
这里重要的一点是,构造函数构成中仅有一个变量,因此您必须在括号中包括对象序列。
We also grab the color and name of the dog, passed in the constructor and stored in the object, within the closure.
我们还在闭包内获取狗的颜色和名字,传递到构造函数中并存储到对象中。
A class can have different constructor methods, differentiated by the different attributes enclosed within the parentheses following the class name.
类可以有不同的构造函数方法,这些方法是通过类名称后的圆括号内附带的不同属性进行区分。
Moreover, there is certain logic within its constructor that would determine whether an instance can be obtained in the first place.
此外,在构造函数内有某种逻辑,这种逻辑将确定是否先获得实例。
The code here USES a local variable diff, which is only defined within this block of code, while later in the constructor a separate variable, fill, is declared at the same level.
这里的代码使用了一个局部变量diff,这个局部变量只定义在这一块代码范围内,之后在构造函数中又声明了另一个相同级别的变量fill。
The application logic shown in Listing 4 is contained within two methods in this class: the constructor and the showProduct method.
清单4 中所示的应用逻辑包含在这个类的两个方法中:构造函数和showProduct方法。
If you do not write a correct code for the copy constructor, object within a list will have some data members uninitialized.
如果你没有为拷贝构造函数写正确的代码,就有可能造成list中对象的某些数据成员没有初始化。
Making it private is the "old" way of doing it. The constructor still exists, but it is private, and can only be invoked from within another class member function.
使其私人的“旧”的方式这样做。构造函数仍然存在,但它是私人的,只能从内部调用另一个类的成员函数。
You can give it a name (that is, a class name), specify parameters (as in a constructor), and even use the .this keyword, which basically means referencing a variable within the scope of the function.
可以给其一个名称(也就是一个类名),指定参数(和在构造函数中一样),甚至可以使用关键字 .this,这意味着在函数范围内引用变量。
Within the setUp method, you instantiate an object array with the actual values the Collaborator class 'constructor needs.
在setUp方法内,用collaborator类的构造方法所需的实际值实例化对象数组。
In the constructor function, a new trace file is opened into which the profiling address trace will be written; within the destructor function, the trace file is closed (see Listing 3).
在constructor函数中,会打开一个新的跟踪文件,分析数据的地址跟踪就是写入这个文件的;在destructor函数中,会关闭这个跟踪文件(参见清单3)。
Within those method and constructor definitions follows the byte codes of these and it describes what these two items are doing (in byte codes).
在这些方法和构造函数的定义如下这些字节码,它描述了这两个项目在做(字节码)。
A type that implements interfaces does not necessarily expose a constructor, and depending on the access level of a constructor, the code within the generic type might not be able to access it.
实现接口的类型不必公开构造函数,并且受构造函数的访问级别限制,泛型类型中的代码可能无法访问该构造函数。
The constructor still exists, but it is private, and can only be invoked from within another class member function.
构造函数仍然存在,但它是私人的,只能从内部调用另一个类的成员函数。
If you want your derived class to set this property, you should do so within the static constructor or in other initialization routines.
如果您希望派生类设置此属性,则应该在静态构造函数或其他初始化例程中完成此工作。
Since version 2.5, in addition to the existing functional API, dhtmlxTree also provides object constructor that allows developers to define object properties within a single command.
自从2.5版本的API,除了现有的功能,还提供了对象的构造dhtmlxTree,允许开发人员定义一个命令对象的属性在。
Since version 2.5, in addition to the existing functional API, dhtmlxTree also provides object constructor that allows developers to define object properties within a single command.
自从2.5版本的API,除了现有的功能,还提供了对象的构造dhtmlxTree,允许开发人员定义一个命令对象的属性在。
应用推荐