3 ms·
I always laughed when people said "yeah, but, why would you ever want two ConnectionManagers? What if you create more than one accidentally! Make it a singleton
by dkersten 12y ago
I always laughed when people said "yeah, but, why would you ever want two ConnectionManagers? What if you create more than one accidentally! Make it a singleton and that can't happen!"
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.