Skip to content

Instantly share code, notes, and snippets.

@pawelpluta
Last active October 8, 2020 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelpluta/d0baada1851b7d0ed8c13541108f91fa to your computer and use it in GitHub Desktop.
Save pawelpluta/d0baada1851b7d0ed8c13541108f91fa to your computer and use it in GitHub Desktop.
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