2 ms·
In my experience I have found that explicitly passing your dependencies around through constructors or method arguments leads to more robust abstractions. Defin
by rojoca 15y ago
In my experience I have found that explicitly passing your dependencies around through constructors or method arguments leads to more robust abstractions. Defining an object as a Singleton from the get-go can lead to its overuse.
If you have to pay the cost of adding a parameter to a method or a constructor you really evaluate whether you need that object in that method in the first place. This doesn't stop you from enforcing a single instance.