DEV Community

loading...

Discussion on: Keeping A Constructor Private

Collapse
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.

Collapse
dehigas profile image
Rajitha Prashan Author

Thanks for the Tip! :D