Creative Technologist Intern at @Fjord. Making the world a better place, and by world I mean my bed.
What is it?
Dependency Injection is a technique that is used to reduce the interdependency of your classes. It keeps each individual classes behavior general, and reduces the likelihood of changes to one class, forcing changes to be made to another dependent class.
Single Responsibility Principle is used to keep classes or methods compact and easy to understand. It allows the objects to be responsible for only one thing: anything that would cause the class to change. It may help to look at some code to illustrate this:
Today was the day. D-Day. The beginning of what I’m sure will be a revelatory and fulfilling journey( and I’m not talking about the hour plus bus ride I took this morning, thanks TFL). Today was Day 1 of Makers Academy! We started the day off introducing each other…