Refactoring Your Code

As you’ve learned, refactoring is a disciplined technique for improving the structure of your code without changing its functionality. In Chapter 4 you looked at the simplest kind of refactoring: renaming files. In addition, you can use refactoring to move properties and methods around. You can even use it to move whole classes around. If there were no refactoring support in Eclipse, it would be cumbersome to move properties, methods, and classes by hand.

Refactoring to implement good principles of design is optimal, because you can make your code easier to understand and much easier to maintain and test. It also makes it much easier to find bugs as well as add functionality in the future.

Before you start, don’t forget ...

Get Learning Android™ Application Programming: A Hands-On Guide to Building Android Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.