A function is more interested in a class than in its own class. The common focus is data. A function calls almost half a dozen value functions from another object to calculate a value. In this case, an applicationMove Method(Shift function)Move it to the desired place. Sometimes only a part of functions suffer from this attachment.Extract Method(Extract function) extract this part into the independent function, and then useMove Method(The moving function) takes it to its dream home.
A function usually uses several types of functions. Where should it be set? Principle: Determine which class has the data most used by this function, and then put this function and that data together. If you useExtract Method(Extraction function)The above steps are easy to complete by decomposing this function into several smaller functions and placing them in different locations.