SlideShare a Scribd company logo
Symfony 4.4
Dependency Injection Improvements
www.oroinc.com
Ilya Antipenko
- Software Engineer Trainer
- Project Lead
- Developer
Dependency Injection
Service Container
- An object that knows how to
instantiate all the application services
- Lazy loaded
- Frozen after build
PSR 11 & Symfony Container
DIC knows how to create the service
Private Services
Symfony Upgrade = New features
Symfony Upgrade = New features + Dropped deprecations
Biggest Changes to DI
- Private Services
- Class name as service id
- Autowiring
- Autoconfiguration
- Controllers as services
- No Bundles
* Most of the listed features were introduced in Symfony 3.3
- Yaml syntax improvements:
- _defaults
- autowiring
- autoconfiguration
- !tagged_iterator
- !iterator
- !service_locator
- !returns_clone
- !service
Class Names as Service Ids
Before
Class Names as Service Ids
After
Two Services with the Same Class
Short Syntax for Services Without Deps
!service for Anonymous Services
Autowiring
- Only configure the parts that you need.
Most configuration is automated.
- Allows you to manage services in the
container with minimal configuration.
Autowiring
File Level _defaults
Autowire Setters
Autowire Single Service
Debug Autowiring from CLI
Class names are links to PhpStorm O_O
https://symfony.com/doc/current/reference/configuration/framework.html#ide
Public and Reusable Bundles
Public bundles should explicitly configure
their services and not rely on autowiring.
Tagged Services
+ CompilerPass
!tagged_iterator for Ordered Collection of Services
!tagged_locator for Indexed Collection of Services
default_index_method & default_priority_method
Autoconfiguration on File Level
Autoconfiguration on Global Level
Unbinding Circular References
- Public service + container injection
- Lazy service
- Oro Service Link
Service Locators
Service Locators
ServiceSubscriberInterface
Private Services by Default
Some are still public:
- Controllers
- Commands
- Services fetched from Container directly
- Lazy Services
- Those that were hard to refactor
Workarounds to Save Upgrade Time
In ContainerAware migrations all*oro*
services are still public
https://github.com/oroinc/platform/tree/
master/src/Oro/Bundle/MigrationBundle/
DependencyInjection/Compiler
Controllers as Services
- Constructor injection
- Arguments injection
- Service Locator
Controllers as Services
Controllers as Services
Conclusion
- Symfony 3.3 DI improvements can now
be fully used
- Services configuration is now much
easier in Yaml
- Less reasons to create a Compiler Pass
- Autowiring is not recommended in
reusable bundles
- DX was significantly improved in
OroPlatform 4.1 LTS, thanks to Symfony
4.4 LTS
Q&A
Revolutionizes Commerce

More Related Content

PDF
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
PPTX
(ATS4-PLAT09) Kerberos & SAML with Accelrys Enterprise Platform 9.0
PDF
Lessons learned migrating 100+ services to Kubernetes
PDF
[WSO2Con EU 2017] An Overview of Ballerina Composer
PDF
Windows Containers - Microsoft Ignite The Tour
PDF
The Ultimate Dependency Manager Shootout (QCon NY 2014)
KEY
Service Oriented Applications
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
(ATS4-PLAT09) Kerberos & SAML with Accelrys Enterprise Platform 9.0
Lessons learned migrating 100+ services to Kubernetes
[WSO2Con EU 2017] An Overview of Ballerina Composer
Windows Containers - Microsoft Ignite The Tour
The Ultimate Dependency Manager Shootout (QCon NY 2014)
Service Oriented Applications

What's hot (20)

PPT
KaTe AMQP Adapter for SAP Process Orchestration / SAP Process Integration
PPT
KaTe RESTful adapter for SAP Process Integration: Introduction
PDF
Микросервисы со Spring Boot & Spring Cloud
PDF
OSGi Community Event 2010 - OSGi Technical Update
PDF
Spring In Alfresco Ecm
PPT
Os Mcmahan
PDF
This is how we REST
PDF
SAP LVM Post Copy Automation Integration
PPTX
ASP.NET Request Processing Internals
PPT
симфони это не страшно
PPTX
Sap integration by mule esb
PPT
OpenAPI 2.0 with SAP PO / SAP PI & KaTe's RESTful adapter
PDF
Oracle API Gateway Installation
PPTX
Creating Perl modules with Dist::Zilla
PPTX
What's new in ASP.NET vNext
PPTX
07 restful webservices design
PDF
Mobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestComm
PPT
Consume wsa
PPT
IIS 7: The Administrator’s Guide
PPTX
How to publish Open api 3.0 with SAP PO and KaTe RESTful adapter
KaTe AMQP Adapter for SAP Process Orchestration / SAP Process Integration
KaTe RESTful adapter for SAP Process Integration: Introduction
Микросервисы со Spring Boot & Spring Cloud
OSGi Community Event 2010 - OSGi Technical Update
Spring In Alfresco Ecm
Os Mcmahan
This is how we REST
SAP LVM Post Copy Automation Integration
ASP.NET Request Processing Internals
симфони это не страшно
Sap integration by mule esb
OpenAPI 2.0 with SAP PO / SAP PI & KaTe's RESTful adapter
Oracle API Gateway Installation
Creating Perl modules with Dist::Zilla
What's new in ASP.NET vNext
07 restful webservices design
Mobicents Summit 2012 - Thomas Quintana - The Future Of PBX With RestComm
Consume wsa
IIS 7: The Administrator’s Guide
How to publish Open api 3.0 with SAP PO and KaTe RESTful adapter
Ad

Similar to Symfony 4.4 Dependency Injection Improvements (20)

PDF
Gear Up for OroPlatform 4.1 LTS. Dependency Injection Improvements Overview ...
PDF
Symfony 4: A new way to develop applications #phpsrb
ODP
Learning Symfony2 by practice
PPTX
A soa approximation on symfony
PPTX
A SOA approximation on symfony
PDF
Dependency Injection in Drupal 8
PDF
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
PDF
Symfony 4: A new way to develop applications #ipc19
PDF
DIC To The Limit – deSymfonyDay, Barcelona 2014
PDF
How Symfony Changed My Life
PDF
Symfony2 - from the trenches
PDF
Symfony2 from the Trenches
ODP
Dependency Injection, Zend Framework and Symfony Container
PDF
Improve your web and app development with the Symfony3 framework.
PDF
Symfony metabook 2.0
PPTX
Dependency injection in Drupal 8 : DrupalCon NOLA
ODP
An introduction to Symfony 2 for symfony 1 developers
KEY
The use of Symfony2 @ Overblog
PDF
Leveraging the Command Pattern: Enhancing Drupal with Symfony Messenger.pdf
PDF
SymfonyCon Cluj 2017 - Symfony at OpenSky
Gear Up for OroPlatform 4.1 LTS. Dependency Injection Improvements Overview ...
Symfony 4: A new way to develop applications #phpsrb
Learning Symfony2 by practice
A soa approximation on symfony
A SOA approximation on symfony
Dependency Injection in Drupal 8
How Symfony changed my life (#SfPot, Paris, 19th November 2015)
Symfony 4: A new way to develop applications #ipc19
DIC To The Limit – deSymfonyDay, Barcelona 2014
How Symfony Changed My Life
Symfony2 - from the trenches
Symfony2 from the Trenches
Dependency Injection, Zend Framework and Symfony Container
Improve your web and app development with the Symfony3 framework.
Symfony metabook 2.0
Dependency injection in Drupal 8 : DrupalCon NOLA
An introduction to Symfony 2 for symfony 1 developers
The use of Symfony2 @ Overblog
Leveraging the Command Pattern: Enhancing Drupal with Symfony Messenger.pdf
SymfonyCon Cluj 2017 - Symfony at OpenSky
Ad

Recently uploaded (20)

PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
System and Network Administraation Chapter 3
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPT
Introduction Database Management System for Course Database
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
Upgrade and Innovation Strategies for SAP ERP Customers
Design an Analysis of Algorithms I-SECS-1021-03
Reimagine Home Health with the Power of Agentic AI​
Odoo Companies in India – Driving Business Transformation.pdf
Digital Strategies for Manufacturing Companies
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Digital Systems & Binary Numbers (comprehensive )
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
System and Network Administraation Chapter 3
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Introduction Database Management System for Course Database
Understanding Forklifts - TECH EHS Solution
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Design an Analysis of Algorithms II-SECS-1021-03
wealthsignaloriginal-com-DS-text-... (1).pdf

Symfony 4.4 Dependency Injection Improvements