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
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
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
710
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
190
Docコメントで始める簡単ガードレール
keisukeikeda
1
130
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
160
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
600
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
620
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.5k
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
150
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.1k
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
2
110
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1.1k
The free-lunch guide to idea circularity
hollycummins
0
280
Featured
See All Featured
The Curse of the Amulet
leimatthew05
1
10k
The untapped power of vector embeddings
frankvandijk
2
1.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
HDC tutorial
michielstock
1
560
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Visualization
eitanlees
150
17k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
150
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
First, design no harm
axbom
PRO
2
1.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
We Are The Robots
honzajavorek
0
200
Making Projects Easy
brettharned
120
6.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