Use Lazy Initialization to Delay Object Instantiation
Posted by: DotNetBips.com Latest Articles,
on 22 Feb 2016 |
View original | Bookmarked: 0 time(s)
It is a common practice to declare object variables as the class members and initialize them in the constructor of the class. At times, however, you need to delay the object instantiation until its first use. One way to achieve such an deferred object instantiation is to write custom code that implements Lazy Load pattern. An easy alternative is to use .NET framework's inbuilt lazy initialization feature. To that end this article explains the later approach....