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:

    The lazy manage to keep up with the earth’s rotation just as well as the industrious.
    Mason Cooley (b. 1927)

    The factory was very fine;
    He wished it all the modern speed.
    Yet, after all, ‘twas not divine,
    That is to say, ‘twas not a church.
    Robert Frost (1874–1963)