Contents tagged with Design Pattern
-
Why and how to use lazy initialization in C# using Lazy<T> API
First of all, why do we need lazy object initialization? The answer is that when initialization of an object for whatever reason is expensive, we would typically wish to instantiate it once and only when it's required. There is an API introduced in .NET Framework called Lazy<T> for this purpose.
-
Ideas behind INotifyPropertyChanged implementation
INotifyPropertyChanged is a standard interface available form the early versions of .NET but still so popular. The general idea behind the implementation of this interface is awareness of the changes in the value of the properties in a class.