Why singletons and not static variables?
It’s a getter.
If you let everything that needs youra reference to the ‘manager’ access it directly you wouldn’t be able run code on access without rewriting everything that accesses it.
For example, to change it from greedy loading to lazy loading you now need to run code later, on access, even if only once.
And so, even though you’re happy writing greedy loading code today, you’re stuck writing boiler plate getter code you don’t need. Why? Because later you might want to make it lazy loading. You have to keep accessing code from knowing or caring which you’re doing.
That is, unless you have properties. Like you do in C#. With those you don’t have to write getter code until you need getter code. Something I get jealous of every time I touch Java.
So why singletons and not static when greedy loading is fine? Because it was written in Java. Or by a Java coder that didn’t know any better.
But singletons are evil!
If you’re stuck in some framework with no access to main or any function that’s only called once (hence no composition root) then they are still useful. Even if they are evil globals. Use them and access them sparingly. If anyone gives you crap about them when you’re stuck in this situation ask them for a better idea.