This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Testing and the fly likes Singletons and testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Singletons and testing" Watch "Singletons and testing" New topic
Author

Singletons and testing

Pepe Papa
Greenhorn

Joined: Jul 26, 2007
Posts: 3
Hi!
i'd like to know if there is any problem with programatic Singletons at test time, which are them?

Thks!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

"pepepapa82"

Please check your private messages.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32312
    
213

Pepe,
It depends. If you want to mock out a class, a singleton makes things much harder than necessary.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Vilmantas Baranauskas
Ranch Hand

Joined: Dec 20, 2006
Posts: 89
Quite interesting article about singletons:
http://steve.yegge.googlepages.com/singleton-considered-stupid


Author of <a href="http://www.newsinjector.com" target="_blank" rel="nofollow">NewsInjector</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Singletons and testing
 
It's not a secret anymore!