DEV Community

Discussion on: Why composition is superior to inheritance as a way of sharing code

Collapse
 
sebastianr1982 profile image
Sebastian Rapetti

Dependency injection instead of inheritance? In the second code snippet I see a dependency injected and a method of this dependency exposed through the method Method().