Skip to content

Instantly share code, notes, and snippets.

@christopherperry
Last active April 10, 2016 03: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 christopherperry/c75391bbdf52e2873844e1e5b78843cf to your computer and use it in GitHub Desktop.
Save christopherperry/c75391bbdf52e2873844e1e5b78843cf to your computer and use it in GitHub Desktop.
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