There are many people against using static public / private methods. I have a search around, with no luck, and tried to find anyone who advocates for the good use of static methods.
Assuming methods will always be Cohesive, where are acceptable areas using public static methods? Do these methods differ between Java and .NET (which is more acceptable in the same)?
This is a recent post from https://stackoverflow.com/a/166269/167/ ... aroused my anger / interest in this topic.
A static method usually should not:
, ( ) .
, .
, . mocks , .
/ /.
, factory, , . , :
string.Empty;
:
string.GenerateRandomString();
. , OO StringFactory RandomStringGenerator, , , .
, - , . - .
, , , , , , .
Singleton.
Static/Shared , , "" ( ).
, "", , , , .
: / , - CLR, , - ( ,.NET), Java - .
, . , . , . , - .