This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
hill:275 [2009/10/13 18:27] hill |
hill:275 [2009/10/13 18:45] hill |
||
---|---|---|---|
Line 64: | Line 64: | ||
//**What information does the type hierarchy give you? Why is it useful for understanding a program?**// | //**What information does the type hierarchy give you? Why is it useful for understanding a program?**// | ||
+ | |||
+ | |||
+ | **Exercise:** Show me an interesting call hierarchy and type hierarchy on **your** project code ("interesting" = more than 3 nodes) | ||
===== Basic Refactoring ===== | ===== Basic Refactoring ===== | ||
+ | |||
+ | //**What is refactoring? Why use it?**// | ||
+ | |||
+ | ==Rename== | ||
+ | * Right click on ''toggleFolded'' and select "Refactor > Rename" | ||
+ | * Add your name at the end of ''toggleFolded'' | ||
+ | * Verify your change is complete by looking at the call hierarchy & double clicking the callers | ||
+ | |||
+ | //**Why rename?**// | ||
+ | |||
+ | ==Extract Method== | ||
+ | * In the renamed ''toggleFolded'', select the 3 statements (6 lines) starting with ''modeController.getAction...'' | ||
+ | * Right click & select "Refactor > Extract Method" | ||
+ | * Enter a name (e.g., "initiateToggleAction") and hit enter | ||
+ | |||
+ | //**Why extract methods?**// | ||
===== Debugging in Eclipse ===== | ===== Debugging in Eclipse ===== | ||
+ | |||
+ | |||
+ | * **Exercise:** Show me a debugging trace for ''toggleFolded''. Which method calls in the trace do you think handle your input method (click, space, right click, etc.)? | ||