DEV Community


Discussion on: Keeping A Constructor Private

just1602 profile image
Justin Lavoie

The downside with this version of the singleton is it is not testable. You can't inject a mock to replace the SingletonObject. A good way to avoid this is to use the testable singleton pattern.

dehigas profile image
Rajitha Prashan Author

Thanks for the Tip! :D