What is the name of this bad practice / anti-pattern?

前端 未结 14 2090
独厮守ぢ
独厮守ぢ 2021-02-03 18:02

I\'m trying to explain to my team why this is bad practice, and am looking for an anti-pattern reference to help in my explanation. This is a very large enterprise app, so here

14条回答
  •  醉梦人生
    2021-02-03 18:48

    I think the anti-pattern name is hard-coding :)

    Whether there should be a ThingBase.supportsX depends at least somewhat on what X is. In rare cases that knowledge might be in ControlStuff() only.

    More usually though, X might be one of set of things in which case ThingBase might need to expose its capabilities using ThingBase.supports(ThingBaseProperty) or some such.

提交回复
热议问题