User talk:AlcorFrom WikiJavaSingleton PatternYou created the Singleton article. I have two notes: 1.) In the LazySingletonFactory example, is there a possibility that in multithreaded environment, more than one Singleton objects are created? That can happen when two thread calls the getSingletonFactory() method in the same time, and the first time. Most of the time this is not a problem, but in some cases when you must have only one instance of the singleton that should be in mind. 2.) The Lazy aspect of the examples only refers to the factory object, and not for singleton objects. Those are created right away when the factory is created So, I would create the factory object always "normaly". And the singeleton objects could be either created normaly or lazyly. Ervinn 15:17, 2 June 2008 (PDT)
I'm copying the discussion to the talk page of the singleton article since it is more relevant there. I will reply in that page. --DonGiulio 16:30, 2 June 2008 (PDT) |
