public void Show() { if (_ebook == null) { _ebook = new RealEbook(_fileName); } _ebook.Show(); }
public void Show() { if (_ebook == null) { _ebook = new RealEbook(_fileName); } System.Console.WriteLine("Logging"); _ebook.Show(); }
public void Show() { // In this example, we have lazy initialization before calling the actual RealEbook object. // Here we could also run other operations like logging, authorization etc. if (realEbook == null) { realEbook = new RealEbook(FileName); } realEbook.Show(); }