该模式和类似的技术有时称为“惰性初始化”,原因是在实际需要之前不执行初始化。
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.
应用推荐