Skip to content

Instantly share code, notes, and snippets.

@raulmoyareyes
Last active July 29, 2018 16:59
Show Gist options
  • Save raulmoyareyes/3bccbe178b4ebc26b9b6bea94ae01ea6 to your computer and use it in GitHub Desktop.
Save raulmoyareyes/3bccbe178b4ebc26b9b6bea94ae01ea6 to your computer and use it in GitHub Desktop.
[ Wrong ] - Dependency Inversion Principle
class Milk {
// implementation
}
class Coffee {
constructor(milk) {
this.milk = milk
}
cost() {
// calculate the cost
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment