Re: [nyphp-talk] Are Singletons Really Evil?

2012-03-19 Thread federico ulfo
Well, I've been using singleton for years, they do what they're supposed to do, make a class object "global", so that you save memory and make the call faster. Singleton/Multiton are not the best solution to make unit testable code and extendible. Dependency Injection dolce this problem, also creat

Re: [nyphp-talk] Are Singletons Really Evil?

2012-03-19 Thread David Mintz
Speaking as less advanced developer than most of you, in my genuinely humble opinion: I hope this isn't off-topic, but I've been working with Zend Framework 1 since it was in diapers. It had a learning curve and seemed a bit heavy but I felt it was worth it in my situation. Now comes ZF2, and as I

Re: [nyphp-talk] Are Singletons Really Evil?

2012-03-19 Thread Anthony W.
I think the "evil" association comes from exactly what you said, people getting burned. However I feel that singleton's do have use. For example a log file, you only really need one instance for example. However there are a couple of reasons why I would argue against implementing a singleton

[nyphp-talk] Are Singletons Really Evil?

2012-03-19 Thread Gary Mort
Yay... Spring is here, blood starts flowing, mind starts stuttering. So I figured I'd ask others opinions on if singleton's really are "evil". It seems to me that "singletons are evil" is part of the a classic programmer pattern: a lot of programmers get burned by something, they declare it