Refactoring at the Method Level
In the last chapter, we covered improving individual lines of code. We’ll expand on those lessons to cover refactoring entire methods and solving issues with how code comes together to form larger methods that then interact with each other.
We saw a little of this in Chapter 2 when we covered the extract method refactoring. However, in this chapter, we’ll expand our set of tools covering the basics of refactoring methods and then move into more advanced areas as we cover the following main topics:
- Refactoring the flight tracker
- Refactoring methods
- Refactoring constructors
- Refactoring parameters
- Refactoring to functions
- Introducing static methods and extension methods