Refactoring: extract and override factory method
I’m sure you have seen classes that initialize a lot of objects in their constructor. These classes may be hard to test because of those object creations I mentioned. To get around this problem we use Extract and override factory method refactoring so we can extend these classes and override some factory methods.
NB! This blog is moved to gunnarpeipman.com
Click here to go to article