Drupal 8 Services and dependency injection | Drupal 8

Drupal 8 Services and dependency injection

Submitted by editor on Thu, 07/07/2016 - 13:58
Question

What is the Services and dependency injection in Drupal 8 ?

 

Drupal 8 introduces the concept of services to decouple reusable functionality and makes these services pluggable and replaceable by registering them with a service container.

As a developer, it is best practice to access any of the services provided by Drupal via the service container to ensure the decoupled nature of these systems is respected.

Links : 

The Symfony 2 documentation
http://symfony.com/doc/current/book/service_container.html
 

Drupal.org
https://www.drupal.org/node/2133171
https://api.drupal.org/api/drupal/core%21core.api.php/group/container/8.2.x
https://api.drupal.org/api/drupal/services

Add new comment