...类在实例化时所需的数据只有在运行时通过计算才能获得,所以我们必须延迟实例化,所以也就有了先前的惰性初始化(Lazy-initialize)--第一次调用时进行初始化。
基于12个网页-相关网页
lazy initialize 考虑使用
One important feature of this repository will be to transparently initialize lazy associations when they are required on the Flex side.
这个仓库的一个重要功能是当懒关联在Flex端被请求的时候,它们要透明地初始化。
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 - demand Holder Class idiom,它提供了迟缓初始化,是线程安全的,而且比双重检查锁定更快且没那么混乱。
应用推荐