When:
to
Room:
Room 2
Tags:
development & coding
Track:
SVG
m&b icon_new brand
coding & site building

Autowiring all the things

Autowiring all the things

Luca Lusso (lussoluca)

Have you ever wondered how Drupal efficiently manages the complex dependencies that power its modules? The service container is the backbone of modern Drupal applications, streamlining service management and boosting performance. With Drupal 11, it’s more potent than ever—fully embracing Symfony’s capabilities to simplify development and unlock new possibilities.

Prerequisite
Some knowledge about how a service is defined and used in a module. Basic PHP object-oriented programming skills.

Outline
The service container, introduced in Drupal 8 as an adaptation of Symfony's Service Container Component, is a cornerstone of modern Drupal applications. It centralizes service management, enabling modules to access and share dependencies efficiently.
With Drupal 11, the service container has evolved significantly, now fully harnessing the capabilities of the original Symfony component. This advancement simplifies dependency management, enhances performance, and gives developers more powerful tools for structuring their applications.
This session will explore key concepts such as dependency autowiring, compiler passes, dynamic services injection, and more. Attendees will gain deeper insight into how these features streamline development, improve maintainability, and open new possibilities for extending Drupal.
Whether you are new to the service container or looking to refine your expertise, this session will provide practical insights and real-world examples to elevate your Drupal development workflow.

Learning Objectives
By the end of this session, attendees will be able to:
Explain the role and architecture of Drupal’s service container.
Identify key features such as dependency autowiring, compiler passes, and dynamic service injection.
Apply best practices for registering and managing services in custom modules.
Optimize service usage to improve code maintainability, performance, and scalability.
Confidently extend or override services to customize Drupal’s behavior.

Experience level
Advanced