lazy initialization
常見例句
- This pattern and similar techniques are sometimes called lazy initialization, since the initialization is not performed until actually required.
該模式和類似的技術(shù)有時(shí)稱為“惰性初始化”,原因是在實(shí)際需要之前不執(zhí)行初始化。 - 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.
該實(shí)例使用滯后初始化的方案并緩存 CA 證書中的公共密匙的引用來避免每次處理程序調(diào)用時(shí)都要重新加載它。 - 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.
延遲初始化的主要弊端是,由于要查看屬性是否已定義,如果沒有,則得到它的值,這會使代碼變得更復(fù)雜。 返回 lazy initialization