You are previewing Refactoring: Improving the Design of Existing Code.

Refactoring: Improving the Design of Existing Code

Cover of Refactoring: Improving the Design of Existing Code by Don Roberts... Published by Addison-Wesley Professional
O'Reilly logo

Chapter 10. Making Method Calls Simpler

Objects are all about interfaces. Coming up with interfaces that are easy to understand and use is a key skill in developing good object-oriented software. This chapter explores refactorings that make interfaces more straightforward.

Often the simplest and most important thing you can do is to change the name of a method. Naming is a key tool in communication. If you understand what a program is doing, you should not be afraid to use Rename Method (273) to pass on that knowledge. You can (and should) also rename variables and classes. On the whole these renamings are fairly simple text replacements, so I haven’t added extra refactorings for them.

Parameters themselves have quite a role to play with interfaces. ...

The best content for your career. Discover unlimited learning on demand for around $1/day.