When refactoring goes wrong

Paul Stovell makes some interesting points regarding refactoring and the separation of UI and business logic.  I agree with Paul that refactoring can be over done but I would put a word of caution around not refactoring duplicate code.  IMHO code that is duplicated is not only a prime candidate for refactoring it nearly always points to an area of the system that needs to be redesigned.  For example say that you have duplicate code between two user controls.  Not only is this code duplicated, it is also likely to be in the wrong place.  As a result of moving this code (most likely business logic) out into a separate class you not only premote reuse, you reduce the number of lines of duplicated code, improve maintainability and you get good separation of ui from business logic.

Leave a comment