DEV Community

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

Thanks for the Tip! :D