-This new refactoring called inline class is the reverse of the extract class - -2
-refactoring. And know that this is kind of a general situation in the - -3
-sense that it is often the case that the refactoring also has a - -4
-reverse refactoring that does exactly the - -5
-opposite. So basically, un-dos, in a sense, - -6
-the operation of the other refactoring. In this case, the motivation for the - -7
-refactoring is that during system evolution, we might end up with one or - -8
-more classes that do not do much. In this case what you want - -9
-to do is to take the class that is not doing that much and - -10
-move its features into another class. And then delete the original class. - -11
-So lets use an example similar to the one we've used for - -12
-the previous refactoring to illustrate how this works. Here we have in - -13
-this case, two classes, person and office. And the person class is - -14
-using the office class, but this latter class, the office class, only - -15
-contains a phone number. So it doesn't really do that much. What - -16
-we can do is therefore to fold the office class into the - -17
-person class, by simply moving its only field into the class. And so - -18
-the result will be this person class that also contains the information - -19
-about the office number, and overall a simpler design for the code. -- cgit 1.4.1