Don't expose class internals
I'm going to disagree a bit with Robert Martin, the author of Clean Code . In his G14 "Feature Envy" smell he uses the example of an method on an HourlyPayCalculator class that takes an HourlyEmployee argument and then uses its properties to do its job. That makes the method "envy" the HourlyEmployee class - the method "wishes it was inside the HourlyEmployee class". So far, so good. Unfortunately, Robert continues with a counter-example to the feature envy smell; he uses the following example (Java code): public class HourlyEmployeeReport { private HourlyEmployee employee; public HourlyEmployeeReport(HourlyEmployee e) { this.employee = e; } String reportHours() { return String.format("Name: %s\tHours: %d.%1d\n", employee.getName(), employee.getTenthsWorked()/10, employee.getTenthsWorked()%10); } } Robert says: "Clearly, the reportHours method envies the HourlyEmployee class. On...