Lazy Initialization - The "lazy Factory"

The "lazy Factory"

In a software design pattern view, lazy initialization is often used together with a factory method pattern. This combines three ideas:

  • using a factory method to get instances of a class (factory method pattern)
  • storing the instances in a map, so you get the same instance the next time you ask for an instance with same parameter (Multiton pattern, similar to the singleton pattern)
  • using lazy initialization to instantiate the object the first time it is requested (lazy initialization pattern).

Read more about this topic:  Lazy Initialization

Famous quotes containing the words lazy and/or factory:

    Along with the lazy man ... the dying man is the immoral man: the former, a subject that does not work; the latter, an object that no longer even makes itself available to be worked on by others.
    Michel de Certeau (1925–1986)

    I am not a suffragist, nor do I believe in “careers” for women, especially a “career” in factory and mill where most working women have their “careers.” A great responsibility rests upon woman—the training of children. This is her most beautiful task.
    Mother Jones (1830–1930)