Mostly fun stuff
Project maintained by theo-pnv
Hosted on GitHub Pages — Theme by mattgraham
Design pattern - Singleton
Intent: Ensures that only one object of a particular class is ever created and provide a global access to it.
- Difficult to test: Can’t be mocked. Global state is preserved between tests, so order of the tests matter, tests can’t be parallelized…
- Makes multi-threading programming harder: e.g. if two threads want to create a singleton at the same time.