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
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.
If it were one string, I might call it a "magic string". In this case, I would consider "magic string array".