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:
“Parents must begin to discover their children as individuals of developing tastes and views and so help them be, and see, themselves as thinking, feeling people. It is far too easy for a middle-years child to absorb an over-simplified picture of himself as a sloppy, unreliable, careless, irresponsible, lazy creature and not much morean attitude toward himself he will carry far beyond these years.”
—Dorothy H. Cohen (20th century)
“... you can have a couple of seconds to rest in. I mean seconds. You have about two seconds to wait while the blanker is on the felt drawing the moisture out. You can stand and relax those two secondsthree seconds at most. You wish you didnt have to work in a factory. When its all you know what to do, thats what you do.”
—Grace Clements, U.S. factory worker. As quoted in Working, book 5, by Studs Terkel (1973)