4 ms·
That's not a singleton, that's just injecting the same instance everywhere.
by masklinn 13y ago
That's not a singleton, that's just injecting the same instance everywhere.
- taeric 13y agoHow is that not a singleton? I can see the argument that dependency injection is better than a factory method. Especially considering the memory model, but I thought this was still a singleton.
- masklinn 13y ago> How is that not a singleton? The way it is normally used, a singleton is a self-managing, globally accessible, single-instanced object (lazy or not). Just having a single instance does not a singleton make.
- taeric 13y agoSo the complaint is against the implementation detail of a singleton? Because, just having a single instance is the crux of the benefit for that pattern.