SlideShare a Scribd company logo
Gear Up for OroPlatform 4.1 LTS.
Dependency Injection Improvements
www.oroinc.com
Andrey Yatsenko
Passionate about Symfony & DX
- Trainer
- Developer
- Developer Advocate
- Mentor of Advanced PHP course on GeekHub
- Symfony 3 Certified Developer (Expert)
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
There are 8000 services
in OroCommerce CE application
Symfony Upgrade
OroPlatform 3.1 LTS
Symfony 3.4 LTS
OroPlatform 4.1 LTS
Symfony 4.4 LTS
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
Dropped Service Class Parameters in Oro Bundles
3rd Party Deps Still Use Service Class Parameters
- akeneo_batch
- doctrine
- fos_js_routing
- hwi_oauth
- jms_serializer
- knp_menu
- nelmio_api_doc
- snc_redis
- stof_doctrine_extensions
- etc.
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.
- Aims to automate configuration
without magic.
Autowiring
File Level _defaults
Autowire Setters
Autowire Single Service
Debug Autowiring from CLI
Class names are links to PhpStorm O_O
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
- DX was significantly improved in
OroPlatform 4.1 LTS, thanks to Symfony
4.4 LTS
Q&A
Revolutionizes Commerce

More Related Content

PDF
Make the most of twig
PDF
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
PDF
MuleSoft Surat Virtual Meetup#34 - OAS 3.0 full API lifecycle support with An...
PPTX
How To Become A Php Geek
PPTX
Developing Rich Internet Applications with Perl and JavaScript
PPTX
Les nouveautés de C# 7
PPTX
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
PDF
Dev + DevOps для PHP розробника
Make the most of twig
EVOLVE'15 | Enhance | Rene Ugarte | AEM Quality Assurance
MuleSoft Surat Virtual Meetup#34 - OAS 3.0 full API lifecycle support with An...
How To Become A Php Geek
Developing Rich Internet Applications with Perl and JavaScript
Les nouveautés de C# 7
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
Dev + DevOps для PHP розробника

What's hot (20)

PDF
Як РНР розробник пише код на Kotlin
PDF
Modularity problems
PDF
Trunk based development
PPTX
Ruby in mule
PPTX
Branching and Merging Practices
PPTX
Let's play with ASP.NET 5 (vNext) RC1
PPTX
Automating JavaScript testing with Jasmine and Perl
PDF
Implementing AutoComplete for Freemarker and Velocity languages in ACE Editor
PDF
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
PDF
Building Command Line Tools with Golang
PDF
A brief intro to RubyMotion
PDF
Continuous delivery of your legacy application
PPTX
Trunk Based Development in the Enterprise - Its Relevance and Economics
PDF
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
PPT
LINQ in Visual Studio 2008
PDF
Feedback from an eclipse plugin developer to provide support to large set of ...
ODP
Lighning Talk: PHP build process
PPTX
Automating SDK generation - London Mobile Forum 2.0
PDF
Crystal
PPTX
Software development terminology
Як РНР розробник пише код на Kotlin
Modularity problems
Trunk based development
Ruby in mule
Branching and Merging Practices
Let's play with ASP.NET 5 (vNext) RC1
Automating JavaScript testing with Jasmine and Perl
Implementing AutoComplete for Freemarker and Velocity languages in ACE Editor
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
Building Command Line Tools with Golang
A brief intro to RubyMotion
Continuous delivery of your legacy application
Trunk Based Development in the Enterprise - Its Relevance and Economics
DevOpsDaysRiga 2018: Neil Crawford - Trunk based development, continuous depl...
LINQ in Visual Studio 2008
Feedback from an eclipse plugin developer to provide support to large set of ...
Lighning Talk: PHP build process
Automating SDK generation - London Mobile Forum 2.0
Crystal
Software development terminology
Ad

Similar to Gear Up for OroPlatform 4.1 LTS. Dependency Injection Improvements Overview and Practical Examples. (20)

PDF
Symfony 4.4 Dependency Injection Improvements
PDF
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
PDF
Symfony 4: A new way to develop applications #ipc19
PDF
"Wie passen Serverless & Autonomous zusammen?"
KEY
The use of Symfony2 @ Overblog
PPTX
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & Providers
PDF
Symfony 4: A new way to develop applications #phpsrb
PPT
Microsoft Forefront - What’s New in FIM 2010 RC1 Presentation
PPT
Railo Presentation Railo 3.1
PDF
IBM Connect Switzerland - Der entspannte Administrator
PDF
Going FaaSter, Functions as a Service at Netflix
PDF
High quality ap is with api platform
PDF
Cisco cme gui features
ODP
An introduction to Symfony 2 for symfony 1 developers
PDF
A Deep Dive into the Liberty Buildpack on IBM BlueMix
PDF
Micro-services meetup
PDF
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
PDF
OSGi Community Event 2010 - OSGi Technical Update
PPTX
F5 Meetup presentation automation 2017
PDF
Apple bonjour
Symfony 4.4 Dependency Injection Improvements
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
Symfony 4: A new way to develop applications #ipc19
"Wie passen Serverless & Autonomous zusammen?"
The use of Symfony2 @ Overblog
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & Providers
Symfony 4: A new way to develop applications #phpsrb
Microsoft Forefront - What’s New in FIM 2010 RC1 Presentation
Railo Presentation Railo 3.1
IBM Connect Switzerland - Der entspannte Administrator
Going FaaSter, Functions as a Service at Netflix
High quality ap is with api platform
Cisco cme gui features
An introduction to Symfony 2 for symfony 1 developers
A Deep Dive into the Liberty Buildpack on IBM BlueMix
Micro-services meetup
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
OSGi Community Event 2010 - OSGi Technical Update
F5 Meetup presentation automation 2017
Apple bonjour
Ad

More from Andrew Yatsenko (9)

PDF
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
PDF
OroCommerce Storefront Design. Non-standard Layout Customisation.
PDF
Effectively Reuse the Code Between PHP Projects
PDF
Performance profiling and testing of symfony application 2
PDF
Using Oro layouts
PDF
Data cache management in php
PDF
Doctrine Internals. UnitOfWork
PDF
Writing extensible applications
PDF
Symfony Form Basics - OroMeetup #3 Cherkassy
Code Quality Control in a PHP project. GeekTalks, Cherkassy 2020
OroCommerce Storefront Design. Non-standard Layout Customisation.
Effectively Reuse the Code Between PHP Projects
Performance profiling and testing of symfony application 2
Using Oro layouts
Data cache management in php
Doctrine Internals. UnitOfWork
Writing extensible applications
Symfony Form Basics - OroMeetup #3 Cherkassy

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Getting Started with Data Integration: FME Form 101
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation theory and applications.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Getting Started with Data Integration: FME Form 101
Diabetes mellitus diagnosis method based random forest with bat algorithm
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
Spectroscopy.pptx food analysis technology
Encapsulation_ Review paper, used for researhc scholars
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation theory and applications.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Group 1 Presentation -Planning and Decision Making .pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
Digital-Transformation-Roadmap-for-Companies.pptx

Gear Up for OroPlatform 4.1 LTS. Dependency Injection Improvements Overview and Practical Examples.