官术网_书友最值得收藏!

Code smells that indicate you might need DI

The saying to a man with only a hammer, every problem looks like a nail is old and yet is never truer than in programming. As professionals, we should be continually striving to acquire more tools to be better equipped for whatever our job throws at us. DI, while a highly useful tool, is useful only for particular nails. In our case, these nails are code smells. Code smells are indications in the code of a potentially deeper problem.

There are many different types of code smell; in this section, we will examine only those that can be alleviated by DI. In later chapters, we will reference these smells as we attempt to remove them from our code.

Code smells generally fall into four different categories:

  • Code bloat
  • Resistance to change
  • Wasted effort
  • Tight coupling
主站蜘蛛池模板: 文登市| 蒙山县| 绥化市| 福泉市| 铜梁县| 静安区| 乐东| 台前县| 曲周县| 岑溪市| 屏东县| 西乌珠穆沁旗| 林口县| 南投县| 北宁市| 太康县| 子长县| 察哈| 海城市| 汝阳县| 玉林市| 丹凤县| 肇庆市| 观塘区| 乌拉特后旗| 焦作市| 固始县| 邵阳县| 钟祥市| 连州市| 屏山县| 嵩明县| 昌都县| 永顺县| 上杭县| 辽阳县| 榆林市| 呼伦贝尔市| 浙江省| 峨边| 武隆县|