Skip to content

Instantly share code, notes, and snippets.

@pawelpluta

pawelpluta/WashingService.java Secret

Last active Oct 8, 2020
Embed
What would you like to do?
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