DRY principle in java [closed]

霸气de小男生 提交于 2019-12-01 13:12:21

DRY is nothing that requires examples. If you are copying and pasting blocks of code from one method, function or block of code to another, then you are in violation of DRY.

Very simply, DRY tells you to move that code into a reusable unit: either into a function or method or macro, or other mechanism relevant to your programming language. If you have places in your codebase where you clearly have very similar code (even with minor variations) then you should be looking to refactor that code to make it DRY.

"Don't repeat yourself!" == "Don't write the same code repeatedly"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!