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.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
270
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
510
better searching with elasticsearch
richardmiller
2
280
Avoiding the mud - Symfony Live London
richardmiller
7
760
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
デザイナーが Androidエンジニアに 挑戦してみた
874wokiite
0
540
奥深くて厄介な「改行」と仲良くなる20分
oguemon
1
560
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
そのAPI、誰のため? Androidライブラリ設計における利用者目線の実践テクニック
mkeeda
2
1.8k
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
3.3k
Swift Updates - Learn Languages 2025
koher
2
490
より安全で効率的な Go コードへ: Protocol Buffers Opaque API の導入
shwatanap
2
460
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
7
2.5k
旅行プランAIエージェント開発の裏側
ippo012
2
920
🔨 小さなビルドシステムを作る
momeemt
4
690
為你自己學 Python - 冷知識篇
eddie
1
350
Reading Rails 1.0 Source Code
okuramasafumi
0
250
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
431
66k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
How to train your dragon (web standard)
notwaldorf
96
6.2k
Docker and Python
trallard
46
3.6k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.6k
Faster Mobile Websites
deanohume
309
31k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
Scaling GitHub
holman
463
140k
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