欢迎光临
我们一直在努力

Bad Smells in Code-JSP教程,Java技巧及代码

建站超值云服务器,限时71元/月

1.duplicated code    same expression in two methods of the same class: extract method    same expression in two sibling subclass:extract method ,then pull up field    duplicated code in two unrelated classs:extract class/the method belongs only in one class and be invoked by the other class.

2.long method   a heuristic we follow is that whenever we feel the needd to comment something,we write a method instead(extract method).a good technology to identify the clumps of code to extract is to look for comments.conditionals and loops also give signs for extraction.

3.large class   extract method

4.long parameters list   replace parameter with method, preserve whole object, introduce parameter object.

5.divergent change   extract class.

6.shotgun surgery   move method, move field, inline class,.

7.feature envy   move method, extract method,.

8.data clumps   extract class, introduce parameter object, preserve whole object

9 primitive obseesion

10.switch statements    extract method

11.parallel inheritance hierarchis

12.lazy class

13.speculative generality

14.temporary field

15.message chains

16.middle man

17.inappropriate intimacy

18.alternative classes with different interfaces

19.incomplete library class

20.data class

21.refused bequest   push down method and push down field

22.comments

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » Bad Smells in Code-JSP教程,Java技巧及代码
分享到: 更多 (0)