Misused design patterns

前端 未结 15 1811
故里飘歌
故里飘歌 2021-02-01 19:54

Are there, in the canonical Gang of Four list, any design patterns that you often find misused, misunderstood or overused (other than the highly debated Singleton)? In other wor

15条回答
  •  忘了有多久
    2021-02-01 20:34

    The singleton pattern .. global state often leads to problems when testing

    Any code depending on the singleton gets harder and harder to test because that dependency isn't easily mocked..

提交回复
热议问题