Singleton design pattern vs dependency injection

I was chatting to the first years today about design patterns in the Object-Oriented Programming course. One of the thing I mentioned was how that the standard Java Singleton pattern is often not a nice solution because it gets in the way of testing.

Dependency injection is an alternative strategy which is motivated nicely in the Google Guice project.

There is also a nice tech talk on this and design for test by Miško Hevery (see his blog on testing):