The Singleton design pattern is not consistent with DI. Although it is possible to open Singleton so much that DI and the Open / Closed Principle begin to make sense, this will greatly change Singleton, it almost ceases to be Singleton.
Thread safety is one big issue that comes to mind when you start opening Singleton.
It is much better to simply define your services and classes without considering too many of their capabilities. If you have an object that you would like to share among multiple consumers, most DI containers have a Singleton lifetime concept that mimics the benefits of the Singleton design pattern without suffering from any flaws.
In short, singleton are evil and should be avoided.
Abstract Factory , on the other hand, is very useful for DI purposes.
Mark seemann
source share