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
Richard Miller
June 11, 2012
Programming
4
1.1k
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
230
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
500
better searching with elasticsearch
richardmiller
2
270
Avoiding the mud - Symfony Live London
richardmiller
7
740
What do I get from the full stack framework?
richardmiller
1
1.5k
Dependency Injection and the Symfony2 Service Container
richardmiller
9
13k
Other Decks in Programming
See All in Programming
Alba: Why, How and What's So Interesting
okuramasafumi
0
210
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.9k
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
13
2.2k
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
280
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
870
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
940
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
2
2.7k
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
210
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
170
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
440
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
7.7k
Featured
See All Featured
Music & Morning Musume
bryan
46
6.3k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
How to Ace a Technical Interview
jacobian
276
23k
The Pragmatic Product Professional
lauravandoore
32
6.4k
A Philosophy of Restraint
colly
203
16k
Typedesign – Prime Four
hannesfritz
40
2.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
Designing Experiences People Love
moore
139
23k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
It's Worth the Effort
3n
183
28k
A designer walks into a library…
pauljervisheath
205
24k
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