Are global static classes and methods bad?

前端 未结 10 1279
予麋鹿
予麋鹿 2020-12-02 13:36

It\'s generally agreed upon that relying heavily on global stuff is to be avoided. Wouldn\'t using static classes and methods be the same thing?

10条回答
  •  一生所求
    2020-12-02 13:50

    Not entirely. Static actually determines when, where and how often something is instantiated, not who has access to it.

提交回复
热议问题