阅读背景:

使用很多静态方法是件坏事吗?

来源:互联网 

I tend to declare as static all the methods in a class when that class doesn't require to keep track of internal states. For example, if I need to transform A into B and don't rely on some internal state C that may vary, I create a static transform. If there is an internal state C that I want to be able to adjust, then I add a constructor to set C and don't use a static transform.I tend to declare as static all the methods in




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: