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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Richard Miller
June 11, 2012
Programming
1.2k
4
Share
Advanced Service Container Utilization
Richard Miller
June 11, 2012
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
530
better searching with elasticsearch
richardmiller
2
310
Avoiding the mud - Symfony Live London
richardmiller
7
790
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
飯MCP
yusukebe
0
490
おれのAgentic Coding 2026/03
tsukasagr
1
140
Vibe NLP for Applied NLP
inesmontani
PRO
0
180
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
360
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
170
Running Swift without an OS
kishikawakatsumi
0
710
20260320登壇資料
pharct
0
170
実践CRDT
tamadeveloper
0
410
Don't Prompt Harder, Structure Better
kitasuke
0
650
Java 21/25 Virtual Threads 소개
debop
0
340
3分でわかるatama plusのQA/about atama plus QA
atamaplus
0
130
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
260
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
160
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
A better future with KSS
kneath
240
18k
Building an army of robots
kneath
306
46k
sira's awesome portfolio website redesign presentation
elsirapls
0
210
New Earth Scene 8
popppiees
3
2k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
93
Leo the Paperboy
mayatellez
7
1.6k
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