4 ms·
Domains often organically have an entity that is well mapped to a singleton. Don't fight the domain if this is the case, you're fighting against reality. But do
by jackblemming 5y ago
Domains often organically have an entity that is well mapped to a singleton. Don't fight the domain if this is the case, you're fighting against reality. But don't reach for a singleton if this isn't the case. Especially bad are singletons that are mutable, for these are just thinly masked globals.