术语描述仅用于修复次优体系结构问题的代码

时间:2014-09-12 09:01:17

标签: architecture terminology anti-patterns

因此,有些术语描述了基于其目的的代码片段 - 例如:

"Boilerplate Code": sections of code that have to be included in many places with little or no alteration

"Glue Code":  code that does not contribute any functionality towards meeting the program's requirements, but instead serves solely to "glue together" different parts of code that would not otherwise be compatible

现在,如果你使用一个没有正确设计的项目,你会发现自己经常添加代码(比如设置状态标志并在各个地方检查它们),它们只能修复/规避正确设计/重构的体系结构中出现的问题不会展出。

是否有任何术语描述这样的“代码只是因为架构不好而需要”?

1 个答案:

答案 0 :(得分:2)

我有自己的术语:“胶带球”或“绷带球”。

可能描述这种情况的一些反模式:

https://en.wikipedia.org/wiki/Big_ball_of_mud

https://en.wikipedia.org/wiki/Stovepipe_system

https://en.wikipedia.org/wiki/Yo-yo_problem

https://en.wikipedia.org/wiki/No_Silver_Bullet(或偶然的复杂性)

和旧经典:

https://en.wikipedia.org/wiki/Spaghetti_code