Good design for class with similar constructors
- by RustyTheBoyRobot
I was reading this question and thought that good points were made, but most of the solutions involved renaming one of the methods. I am refactoring some poorly written code and I've run into this situation:
public class Entity {
public Entity(String uniqueIdentifier, boolean isSerialNumber) {
if (isSerialNumber) {
this.serialNumber =…