Using DI to Avoid Inheritance

I often find myself using inheritance to try and DRY up my codebase. However, that can easily lead to inheritance hell, which you know you are in when: You have to implement methods you don't want/need in child classes. You enter the "great" territory with great-grandparent and great-great-grandparent classes.…

Read this article

Dependency Injection

Anthony Ferrara has a brilliantly simple youtube video explaining dependency injection that I highly recommend. In basic terms, anywhere that you pass an object into another Class's constructor, rather than creating a new instance of that object within the constructor, you are using dependency injection. Dependency injection allows for high…

Read this article