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:
“Take us generally as a people, we are neither lazy nor idle; and considering how little we have to excite or stimulate us, I am almost astonished that there are so many industrious and ambitious ones to be found; although I acknowledge, with extreme sorrow, that there are some who never were and never will be serviceable to society. And have you not a similar class among yourselves?”
—Maria Stewart (18031879)
“If the factory people outside the colleges live under the discipline of narrow means, the people inside live under almost every other kind of discipline except that of narrow meansfrom the fruity austerities of learning, through the iron rations of English gentlemanhood, down to the modest disadvantages of occupying cold stone buildings without central heating and having to cross two or three quadrangles to take a bath.”
—Margaret Halsey (b. 1910)