Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Advanced Service Container Utilization
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Richard Miller
June 11, 2012
Programming
4
1.2k
Advanced Service Container Utilization
Richard Miller
June 11, 2012
Tweet
Share
More Decks by Richard Miller
See All by Richard Miller
Introduction to Symfony2 - DrupalCamp London 2014
richardmiller
0
310
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
520
better searching with elasticsearch
richardmiller
2
300
Avoiding the mud - Symfony Live London
richardmiller
7
780
What do I get from the full stack framework?
richardmiller
1
1.6k
Dependency Injection and the Symfony2 Service Container
richardmiller
9
13k
Other Decks in Programming
See All in Programming
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.5k
SourceGeneratorのマーカー属性問題について
htkym
0
210
CSC307 Lecture 15
javiergs
PRO
0
260
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
190
20260315 AWSなんもわからん🥲
chiilog
2
170
Pythonデータ分析コトハジメinFukuoka
kanan
0
100
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
420
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
180
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
970
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1.1k
へんな働き方
yusukebe
5
2.8k
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
7
3.1k
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
84
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
320
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
220
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
650
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
160
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
390
Transcript
Advanced Service Container Utilization by Richard Miller (@mr_r_miller)
None
None
Getting the most from the Symfony2 service container
Knowing the injection options open to you
You may get to inject into the constructor
You might get to Inject into setter methods
You may have to inject into properties
You can integrate objects created by factories
You may need to integrate a static factory method
You can configure the container to use the factory method
You may be dealing with a separate factory object
You can also accommodate this with container configuration
Saving time by reducing the amount of configuration you have
to write
The wrong way with interface injection
What is interface injection?
How is interface injection configured?
Why you can't use it
The right way with parent services
You can have parent classes to reduce code repetition
You can also have a parent service to reduce repetitive
configuration
You can change configuration independently from code
Understanding the service container compilation process
You need to call compile if using the component outside
the framework
You get to load complex config from extensions
Using compiler passes to respond to other configuration
What if you want to use services from other bundles?
You need to dynamically register the tagged services
You can register compiler passes from bundles in the framework
Dumping the compiled container for performance
You get the performance benefits by caching the dumped container
You get convenience as well by avoiding the cache in
debug mode
Getting the most from the Symfony2 service container
Questions? @mr_r_miller richardmiller.co.uk