0

two little suggestions in Large Class treatments

vaclav hapla 2 місяці тому 0

In https://refactoring.guru/extract-class, it would be more natural to have getOfficeTelephoneNumber() in Person, and areaCode and number in TelephoneNumber. Because the "office" suffix smells like a specific instance of a telephone number :-) The Person could also have getPersonalTelephoneNumber(), for instance.

In https://refactoring.guru/extract-subclass, I think the base class on the right side should NOT have getUnitPrice() and getEmpoyee(). Otherwise, it still has the "features that are used only in certain cases".