Design Pattern: Lazy Loading

When you hear this term at first, it gives the feeling something is not going well 🙂

But this is a very useful design pattern to solve the lazy loading of objects in your applications. This is basically for the improvement of performance of your application.

Here are the four methods of implementing Lazy Loading pattern:

  • Lazy Initialization – The default value of an object will be NULL. When a request for an object comes, it creates the real object on the fly.
  • Virtual Proxy – It is a kind of wrapper. It provides an object which is a kind of clone of the original object. The object gets created when any one of its property or method is accessed.
  • Ghost – It is the real object which is in a partial-loaded stage. Like in Virtual Proxy, the object will be ‘completed’ once any of its property or method is accessed
  • Value Holder – It is a generic object which appears in place of object’s data fields.

 

More information here.

 

Design Pattern: Lazy Loading

When you hear this term at first, it gives the feeling something is not going well 🙂

But this is a very useful design pattern to solve the lazy loading of objects in your applications. This is basically for the improvement of performance of your application.

Here are the four methods of implementing Lazy Loading pattern:

  • Lazy Initialization – The default value of an object will be NULL. When a request for an object comes, it creates the real object on the fly.
  • Virtual Proxy – It is a kind of wrapper. It provides an object which is a kind of clone of the original object. The object gets created when any one of its property or method is accessed.
  • Ghost – It is the real object which is in a partial-loaded stage. Like in Virtual Proxy, the object will be ‘completed’ once any of its property or method is accessed
  • Value Holder – It is a generic object which appears in place of object’s data fields.

 

More information here.