Skip to main content

What the heck is Dependency Injection?!?!?!

Backend & Dev-ops
Salman Jaffery
Audience Experience Level
Drupal Intermediate

We all must have heard about dependency injection one way or another but what the heck is it and how and why do we use it.

With Drupal 9 on the horizon, functional programming is on the way with a lot of the functions that we have come to rely biting the dust (DEPRECATED) one after another.

As such if we are to do object oriented programming properly, one topic that we must learn to understand is Dependency Injection or passing stuff into out classes and objects.

Lets explore this together and see how it works with Drupal 8.