Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Coffee Maker Dependency Inversion Example
package coffee.maker;
import coffee.maker.heater.ElectricHeater;
import coffee.maker.pump.Thermosiphon;
public class CoffeeMaker {
private final ElectricHeater heater;
private final Thermosiphon thermosiphon;
public CoffeeMaker() {
heater = new ElectricHeater();
thermosiphon = new Thermosiphon();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment