Skip to content

Instantly share code, notes, and snippets.

Last active October 8, 2020 19:40
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.setProgramme(new Programme(temperature, spinSpeed));
return washingMachine.getLaundry();
/* other wash method */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment