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
1.3k
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
320
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
540
better searching with elasticsearch
richardmiller
2
320
Avoiding the mud - Symfony Live London
richardmiller
7
790
What do I get from the full stack framework?
richardmiller
1
1.7k
Dependency Injection and the Symfony2 Service Container
richardmiller
9
13k
Other Decks in Programming
See All in Programming
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
360
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
170
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
270
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
3
570
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
140
iOS26時代の新規アプリ開発
yuukiw00w
0
200
横断組織出身のQAEがインプロセスQAEでつまずいたこと・活かせたこと
ty89
0
180
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
130
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
250
AgentCore Optimizationを始めよう!
licux
4
280
色即是空、空即是色、データサイエンス
kamoneggi
1
150
inferと仲良くなる10分間
ryokatsuse
1
240
Featured
See All Featured
Docker and Python
trallard
47
3.8k
Scaling GitHub
holman
464
140k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.1k
Facilitating Awesome Meetings
lara
57
6.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
200
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
How STYLIGHT went responsive
nonsquared
100
6.1k
Being A Developer After 40
akosma
91
590k
GraphQLとの向き合い方2022年版
quramy
50
15k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
260
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