Load On Demand

Unlike ResourceAcquisitionIsInitialization, LoadOnDemand defers the creation of a costly resource to a point in time when that resource is actually needed. Often, that point in time is never, which is a quite substantial improvement.

Common implementations use a flag (bool loaded, bool opened, etc.), or create an empty envelope that fills itself when it's opened (yeah, the metaphor is lacking there).


Is this analogous to DeferredInstantiation?? -- DrewMarsh

No, it's more special in that it implies a costly resource. DeferredConstruction? is a way to implement LoadOnDemand, but DeferredInstantiation? covers more cases, like when you need to supply some data to open a resource (like some resource identifier, which is needed to access the resource).


Is this like LazyObject? -- ErikMeade


EditText of this page (last edited December 17, 2010) or FindPage with title or text search