Article: The OOP has been explained wrongly to you - solution
class WashingService { | |
private static final BigDecimal MAX_LAUNDRY_WEIGHT = BigDecimal.valueOf(7); | |
Laundry washWool(WashingMachine washingMachine, | |
Laundry laundry, | |
Integer spinSpeed, | |
Integer temperature) { | |
Laundry laundryToBeDone = maximumLoadFrom(laundry); | |
washingMachine.setLaundry(laundryToBeDone); | |
washingMachine.setProgramme(new Programme(temperature, spinSpeed)); | |
washingMachine.wash(); | |
return washingMachine.getLaundry(); | |
} | |
/* other wash method */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment