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:
1.) resource usage for the life of the application
2.) thread issues (not really an issue in PHP)
3.) is this the only way, how about exposure via an interface?
Here are reasons why I argue for implementing a singleton:
1.) they describe a unique resource of the application
2.) global data is sometimes necessary
3.) limit abuse of finite system resources
I could go on all day about this but I would like to hear other arguments.
--
Anthony W.
ant92...@gmail.com
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org/show-participation