According to this Monostates definition, this note:
"Monostats are evil just like SingletonsAreEvil .
I do not necessarily agree. The basic premise is that Singletones and Monostats are global variables, and since the Globals are evil, so should Singletones and Monostats.
The problem with this line of reasoning is that it does not take into account why the globals are evil. Globals are evil primarily because they are variables that can be obtained outside the local area by chance, just as non-typed languages often allow you to create variables simply by referencing them.
Singlets and monostats cannot cause the same problems, because it is almost impossible to “accidentally” refer to global statics, call the instance method, and then use the instance.
In other words, globals are evil because they cause subtle and difficult problems. Singletones and Monostats do not cause the same problems, so I do not see them as evil for the same reasons that most people seem to be mistaken in this argument.
Now, can synods and monostats cause other problems? Sure. TDD people seem to hate them because they are hard to test with automated testing. Good, great, but for those people who don’t use TDD, these problems do not exist.
Of course, singles may be misused. People who use them simply to avoid passing the instance misuse them. I think Monostates is better for this than singleton.
Many people offer factory templates instead of singletones, but I feel that Factories are just fancy single-pole generators. No, there is no static "instance" method, but it basically does the same thing (when the factory creates one instance of the object that is). Factory. Creation is no different from Singleton.Instance.
EDIT:
One aspect of Singletons and Monostates comparable to Globals is that they are separate and therefore not thread safe. Although this is troubling if you plan to make multi-threaded applications, if you know this, you can take steps to serialize access to shared objects. Thus, this is probably the only area where, as a rule, all three types can be considered as causing problems.