Misused design patterns

前端 未结 15 1489
故里飘歌
故里飘歌 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:47

    Only use a pattern when its called for. You can't predict the future, so while you might put a pattern in to make the design flexible, what happens when the product takes a different direction and your pattern becomes the very thing that's keeping you from implementing what your users want?

    Keep designs as simple as possible to start with. When you know more about how your design needs to change, use the appropriate pattern and not before.

提交回复
热议问题