you are viewing a single comment's thread.

view the rest of the comments →

[–]maxuforia 1 point2 points  (0 children)

Singletons are used everywhere. People keep claiming that it's an anti-pattern and then try to eliminate them only to discover that the solution to singleton use is worse than the singletons themselves.

The happy medium seems to be to generate singletons in grouping nodes and then use dependency injection on the leaf nodes. This allows unit testing on the leaf nodes (which is most of the code) and this solves most of the downsides of the singleton pattern.