by smrtinsert · 11y ago · 0 comments
Then unit testing becomes feasible again, without having to hack around that Class X is using the "ConnectionManager" to connect to the database behind your back.
My reply was along the lines of "when was the last time you accidentally wrote two for loops when you wanted only one? If you don't want more than one ConnectionManagers then don't create more than one"
In my opinion its very rare that you need an object that is both globally accessible and you must not have more than one.