Working with the Lazy delegate

Lazy initialization is another design pattern that has its dedicated delegate implementation included in the standard library. The concept of lazy initialization refers to the strategy of delaying the creation of an object, calculation of a value, or execution of some expensive operation until the first time it's needed. In this recipe, we are going to define a sample class, CoffeeMaker, and declare an object of its type via the Lazy delegate. Then we are going to perform example operations on the object to explore how the lazy delegate is working in action.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.95.68