Refactoring

Refactoring - Refactoring Very seldom you will start code...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Refactoring Very seldom you will start code from scratch. More often you will add or maintain to existing code. For this reason you have to write your code to be maintainable, so you or other people can understand it. After implementing a feature or fixing a bug, see opportunities to make your code look better. See http://wiki.java.net/bin/view/People/SmellsToRefa ctorings
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Comments Should only be used to clarify "why" not "what". Can quickly become verbose and reduce code clarity. Extract Method Rename Method Introduce Assertion Long Method The longer the method the harder it is to see what it is doing. Extract Method Replace Temp with Query Introduce Parameter Object Preserve Whole Object Replace Method with Method Object Long Parameter List Don't pass in everything the method needs; pass in enough so that the method can get to everything it needs. Replace Parameter with Method
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Refactoring - Refactoring Very seldom you will start code...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online