Skip to content

Instantly share code, notes, and snippets.

@raulmoyareyes
Created July 29, 2018 16:32
Show Gist options
  • Save raulmoyareyes/c4b108c2777f44ebc62b683f97100ba8 to your computer and use it in GitHub Desktop.
Save raulmoyareyes/c4b108c2777f44ebc62b683f97100ba8 to your computer and use it in GitHub Desktop.
[ Wrong ] - Interface Segregation Principle
class Car {
startEngine() {}
accelerate() {}
backToThePast() {}
backToTheFuture() {}
}
class Seat extends Car {
startEngine() {
// start engine...
}
accelerate() {
// accelerate...
}
}
class DeloRean extends Car {
startEngine() {
// start engine...
}
accelerate() {
// accelerate...
}
backToThePast() {
// back to the past...
}
backToTheFuture() {
// back to the future...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment