3 ms·
Point in case: A singleton holding a factory to create a single instance of a fairly simple class.
by heisenbit 1y ago
Point in case: A singleton holding a factory to create a single instance of a fairly simple class.
- procaryote 1y agoI've seen so many singletons that just exist because java lacks conditional compilation, and you need either a test-something or a real-something. Of course I've also seen heaps of singletons that exist for no reason and could just have been a static class, sometimes because of cargo cult, sometimes because "what if we want to make it configurable later?" Such a waste of energy