3 ms·
> SingletonFactory is an oxymoron. It's not, you still need to create the one instance when it is first needed. It's possibly excessive abstraction, but it's n
by dragonwriter 7y ago
> SingletonFactory is an oxymoron.
It's not, you still need to create the one instance when it is first needed. It's possibly excessive abstraction, but it's not an oxymoron.
- sidlls 7y agoI've come to believe that "excessive abstraction" is practically a synonym for "object oriented programming". It takes an incredible amount of discipline to not abstract unnecessarily in an OO shop.
- anoncake 7y agoIt's not just excessive abstraction, separating Singleton and SingletonFactory can even reduce encapsulation since you can't make the Singleton constructor private.
- reificator 7y agoYou can if it's in the same file.