June 20, 2010

...Learn TDD with Codemanship

Bonus Code Smell Of The Week - Duplication II : Copy & Paste Inheritance

OK, so definitely not weekly. But not daily, either. Whatever.

As mentioned in the last video, I'm illustrating here how you can refactor two very similar classes (probably as a result of one being copied and pasted to create the other - heaven forbid!) so that all the code common to both is in a shared base class by way of the Extract Super Class refactoring.

For training and coaching in refactoring, test-driven development and OO design, visit http://www.codemanship.com

Posted 7 years, 10 months ago on June 20, 2010