4 ms·
Then what? Then you use dependency injection if you think you need a singleton, and inject a single instance of a cache object. Which means you can mock it when
by mercurial 13y ago
Then what? Then you use dependency injection if you think you need a singleton, and inject a single instance of a cache object. Which means you can mock it when unit testing, or make different instances of it if needed, or have different implementations of it.