classrefactoringanti-patternsgod-object

How do you refactor a God class?


Does anyone know the best way to refactor a God-object?

Its not as simple as breaking it into a number of smaller classes, because there is a high method coupling. If I pull out one method, i usually end up pulling every other method out.


Solution

  • It's like Jenga. You will need patience and a steady hand, otherwise you have to recreate everything from scratch. Which is not bad, per se - sometimes one needs to throw away code.

    Other advice: