next up previous contents
Next: References Up: Refactoring Example Previous: The Two Subclasses of

Comparison of the Code before and after the refactoring

To visualize the result of the refactoring of the database server class, I listed the code of the single class before the refactoring and the code of the 4 resulting classes after the refactoring.

Besides reducing the general number of lines, the resulting code looks much lighter as there are no more large blocks of code clumped together in a single method but rather small methods which either call other methods to delegate the work to do or containing only a few lines of computing code.

  figure461
Figure A.1: Comparison of the Code before and after the refactoring


next up previous contents
Next: References Up: Refactoring Example Previous: The Two Subclasses of

Michael Hunger
Mit Okt 25 00:48:16 MEST 2000