Question on Singleton
Posted: Thu Mar 29, 2007 2:14 pm
Hi all,
ok so this is all about the singleton pattern. I find it pretty usefull, but I often read, that singletons are anti-patterns and they are no good use for OOP because they sprinkle dependencies all over the place in my programm. Still, I find myself using this pattern quite often. I wrap it around database connections, sessions, user-objects, Error-message-collectors, Input-Controllers and so on. So what do you think, is this good practice? Or what should I use instead?
cya
ok so this is all about the singleton pattern. I find it pretty usefull, but I often read, that singletons are anti-patterns and they are no good use for OOP because they sprinkle dependencies all over the place in my programm. Still, I find myself using this pattern quite often. I wrap it around database connections, sessions, user-objects, Error-message-collectors, Input-Controllers and so on. So what do you think, is this good practice? Or what should I use instead?
cya