Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Point in case: A singleton holding a factory to create a single instance of a fairly simple class.


I'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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: