1.Duplicated Code Same expression in two methods to the Same Class:extract method Same expression in two sibling Su Bclass:extract method, then Pull up Field duplicated code into two unrelated Classs:extract method class/the In one class and is invoked by the other class.
2.Long Method A Heuristic We follow be that whenever we feel the Needd to comment something,we write a method instead (Ex Tract method). A Good technology to identify the clumps of code to extract are 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,.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service