Transforming Dependency Injection from complex to a simpler term.

neetu morwani

With Drupal 8, now a symfony based CMS, being launched, there is a rush of mixed reactions among people.
Surge of anxiety can be felt along with the feeling of accomplishment in the community. Shift from mostly procedural code to OOPs based architecture has introduced us to various of new concepts and terms which we do not understand fully.
In this session, I will be talking about the most popular & challenging term 'Dependency injection'.

What is Dependency injection?
Dependency injection as the name suggests is a way to inject some dependencies in our code.

The above statement itself raises many questions. Few of them would be-
What is a dependency?
How do we inject it?
Why do we need to inject a dependency?
How will it be beneficial to our site?

The session will start with the brief introduction to Services followed by the concept of Service Container.
Dependency Injection is one of the prime features of Drupal 8 and none of the Drupal 8 site will be possible without this. We will be talking about services defined in Drupal 8 core and how they make our life simpler and easier.

We will also learn about creating our own custom services and injecting them.Best practices to be kept in mind while injecting services will also be discussed.

This session will have a quick demo wherein we will be quickly walking through the services defined in the code and how they are being used.

By end of the session, Dependency injection will no longer be a complex term.

Session Track

Symfony

Experience Level

Intermediate

Drupal Version