There is nothing wrong with having `MyLib.getInsta...
# announcements
m
There is nothing wrong with having
MyLib.getInstance()
in a library, but it should return an interface instead of concrete object, so users don't have to write a wrapper if they want to mock it easily or have different implementation provided by your DI framework in tests. Also the documentation should show that it's not good to use
MyLib.getInstance()
everywhere in the code.
👍 1