HI Neil, On Thu, Feb 12, 2009 at 2:59 PM, Neil Groves <[email protected]> wrote: > While I fully appreciate that a large scale removal of singletons that > appear not to have defects is undesirable. I would like to put forward > various references that explain why the singleton pattern is now considered > by many (most?) software engineers to be an anti-pattern.
Many (most?).... I think this type of emotive, and unsubstantial prose to be very poor. It's just text pulled out of the air to sound credible. Have you done a poll of large sample of developers? Please just present what others have written, or what you think as your own opinion. Let others decide. I've just scanned the links, and I can see a few points of interest, but nicely framed to ignore that cases when Singleton is still very fit for purposes. As for it being an anti-pattern, well I'd say that all design patterns are potential anti-patterns, it's all comes down to individual context and implementation. In the case of the OSG's use of Singleton's the main ones are motivated by loose coupling and extensibility, consider the osgDB::Registry and the loose coupling with ReaderWriter's and DotOsgWrappers. If you don't use a Singleton then you have to break the loose coupling and explicitly register all ReaderWriter's and DotOsgWrappers. Now if you can point me at a better approach than a Singleton for the above role then I'm all ears, but claim the Singleton is an anti-pattern and shouldn't be used, but without any specific discussion about what one would use instead is pretty unhelpful case of tire kicking. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

