Moving features between objects
As we have already mentioned several times, and as those who have been in this profession for more than a few years know organizing our code is perhaps one of the most challenging parts. Personally, I believe I have never managed to get the design of a software project right on the first try. But, once again, the software is fortunately (or unfortunately!) malleable, so with the right limits and a good amount of refactoring, we can move methods and fields from one class to another without too much difficulty. We can decide to extract a class or remove one and inline it. Above all, we can eliminate the so-called dead code. But let’s start showing something.
Moving a method or field
This refactoring is quite basic (Martin Fowler calls it the “bread and butter” of refactorings), but it is one of the most frequently performed ones. This is because, as we have already mentioned, it is good practice to maintain a certain modularity...