Lazy Loading Pattern
Intent An object that doesn�t contain all of the data you need but knows how to get it. This pattern is commonly found in most of the OR mappers, e.g. Hibernate. Example When you load the company from company table, you may or may not want to load employees data from the employees table. Using Lazy Load pattern, you load company from company table , and employees data can be loaded when it is needed. Key Points One object can have the effect of loading a huge number of related objects�something that hurts performance when only a few of the objects are actually needed. Lazy loading is a concept where we delay the loading of an object until the point where we need it. In simple words, Lazy loading is a software design pattern where the initialization of an object occurs only when it is actually needed and not before to preserve the simplicity of usage and improve performance. Applicability Use the Lazy Loading idiom when eager loading is expensive...