该模式和类似的技术有时称为“惰性初始化”,原因是在实际需要之前不执行初始化。
This pattern and similar techniques are sometimes called lazy initialization, since the initialization is not performed until actually required.
在很多情况下,当初始化可以作为针对对象的第一个请求的一部分发生时,惰性初始化很有用。
Lazy initialization is quite useful in a number of scenarios when the initialization can occur as part of the first request to an object.
希望您的代码设计为惰性,这样初始化就变得不重要。
With hope, your code is designed to be lazy and this initialization is not important.
通常,我们尽可能多地以惰性方式(延迟或在需要时)执行初始化。
Normally, we would do as much initialization as possible in a lazy manner (delayed or when needed).
由于单例对象作为实例存在而不是类的静态成员,所以你能够惰性地初始化单例对象,即只需要在第一次用它的时候才去创建它。
With singletons implemented as single instances instead of static class members, you can initialize the singleton lazily, creating it only when it is first used.
在DMF-四乙基溴化铵(TEAB)质子惰性介质中,马蔺子素连续两步单电子还原生成相应氢醌阴离子,无中间体半醌自由基的化学反应发生。
In DMF tetraethyl ammonium bromide(TEAB) media, the reduction of irisquinone was two successive single electron processes without the chemical reaction of the free radical semiquinone.
学院派书法的“复杂化”不仅表现在创作和欣赏的二元主体结构中,而且还表现在创作主体的整个创作过程中; 学院派书法创作的重要贡献之一,是对古代书法传统中潜在的惰性因素的扬弃而代之以系统的“制作”实践。
The "complexity"of the college school calligraphy is not only in two main body forms of creation and appreciation, but it is also in the course of whole creation of the main body cereation.
学院派书法的“复杂化”不仅表现在创作和欣赏的二元主体结构中,而且还表现在创作主体的整个创作过程中; 学院派书法创作的重要贡献之一,是对古代书法传统中潜在的惰性因素的扬弃而代之以系统的“制作”实践。
The "complexity"of the college school calligraphy is not only in two main body forms of creation and appreciation, but it is also in the course of whole creation of the main body cereation.
应用推荐