Skip to main content
5 events
when toggle format what by license comment
Mar 3, 2011 at 21:02 history made wiki Post Made Community Wiki
Sep 24, 2010 at 16:16 comment added Tarka Only time I've ever seen need for it is database connections. That said, nearly every "Service" (read: similar to factory) class in this project at work is a singleton, stored in the PHP $_SESSION variable.
Sep 24, 2010 at 15:31 comment added Cristian Of course, in those cases it's not needed... what about when you really need one object to do some job, synchronously, and thread safe. Singleton is not just for holding the state of some static variables, it's a real object with real job to do, etc.
Sep 24, 2010 at 15:01 comment added Robert Harvey Funny, but I've never had the need to use a Singleton. If I need someplace to hold global state, I put it in a configuration file and use a normal class to access it.
Sep 24, 2010 at 14:43 history answered Cristian CC BY-SA 2.5