Don't talk down to people, even when you doubt them. It's not a good look :)
Context is an application of the principles behind DI, sure, but that doesn't really address my point.
Context is an application of the principles behind DI, sure, but that doesn't really address my point.
* By using a singleton you're not able to easily test different LocaleData contexts in parallel.
* By using a singleton you're not able to make your NodeJS server deal with users with different locale settings because you have only one global instance. Multiple requests arriving at the same time would corrupt each other. You could spawn a separate process for each locale but that's inconvenient.
Does that make sense?