使用延迟初始化。
Lazy initialization of memory structures will save CPU time and may defer the activation of other plug-ins.
内存结构的滞后初始化可以节省CPU时间并延迟其他插件的激活。
Lazy initialization: it sometimes makes sense to defer initialization if the cost of initialization is significant.
延迟初始化:如果初始化成本过高,有时推迟初始化的过程是很有用的。
Lazy initialization is quite useful in a number of scenarios when the initialization can occur as part of the first request to an object.
在很多情况下,当初始化可以作为针对对象的第一个请求的一部分发生时,惰性初始化很有用。
This pattern and similar techniques are sometimes called lazy initialization, since the initialization is not performed until actually required.
该模式和类似的技术有时称为“惰性初始化”,原因是在实际需要之前不执行初始化。
The example uses a lazy initialization approach and caches a reference to the Public Key from the CA Certificate to avoid the need to reload it each time the handler is invoked.
该实例使用滞后初始化的方案并缓存CA证书中的公共密匙的引用来避免每次处理程序调用时都要重新加载它。
The main disadvantage of lazy initialization is your code becomes more complex because you need to check to see if the attribute has been defined yet and, if not, obtain its value.
延迟初始化的主要弊端是,由于要查看属性是否已定义,如果没有,则得到它的值,这会使代码变得更复杂。
The main disadvantage of lazy initialization is that your code becomes more complex because you need to check to see if the attribute has been defined yet and, if not, obtain its value.
延迟初始化的主要缺点是:代码将变得更复杂,因为需要查看是否定义了属性,如果还未定义,则要获取属性值。
Instead of double-checked locking, use the Initialize-on-demand Holder Class idiom, which provides lazy initialization, is thread-safe, and is faster and less confusing than double-checked locking.
不使用双重检查锁定,而使用Initialize - on - demandHolderClassidiom,它提供了迟缓初始化,是线程安全的,而且比双重检查锁定更快且没那么混乱。
Finally, lazy acquisition pattern was applied to the initialization of services by exposing a startup method with the framework context interface.
最后,利用框架上下文接口公开一个启动方法,从而将延迟获取模式应用在服务的初始化中。
Normally, we would do as much initialization as possible in a lazy manner (delayed or when needed).
通常,我们尽可能多地以惰性方式(延迟或在需要时)执行初始化。
With hope, your code is designed to be lazy and this initialization is not important.
希望您的代码设计为惰性,这样初始化就变得不重要。
This smart client caches reusable data, asynchronously prefetches data that will be needed, defers initialization until an object is needed (also called "lazy loading"), and so forth.
该灵巧客户端会缓存再使用数据,异步预取需要的数据,延缓初始化直到需要对象为止(也叫做“载入缓慢”),等等。
The default-activation=”lazy” parameter in the XML indicates that the component’s manager is activated on demand and not on initialization of the Blueprint container.
XML 中的 default-activation=”lazy”参数指出组件管理器根据需要激活,不是在Blueprint 容器初始化时激活。
The default-activation=”lazy” parameter in the XML indicates that the component’s manager is activated on demand and not on initialization of the Blueprint container.
XML 中的 default-activation=”lazy”参数指出组件管理器根据需要激活,不是在Blueprint 容器初始化时激活。
应用推荐