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:
“So, when my days of impotence approach,
And Im by pox and wines unlucky chance
Forced from the pleasing billows of debauch
On the dull shore of lazy temperance,
My pains at least some respite shall afford
While I behold the battles you maintain
When fleets of glasses sail about the board,
From whose broadsides volleys of wit shall rain.”
—John Wilmot, 2d Earl Of Rochester (16471680)
“The man who builds a factory builds a temple, that the man who works there worships there, and to each is due, not scorn and blame, but reverence and praise.”
—Calvin Coolidge (18721933)