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
250
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
500
better searching with elasticsearch
richardmiller
2
280
Avoiding the mud - Symfony Live London
richardmiller
7
750
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
Language Server と喋ろう – TSKaigi 2025
pizzacat83
2
670
TSConfigからTypeScriptの世界を覗く
planck16
2
1.3k
マテリアルって何者?RealityKitで扱うマテリアル入門
nao_randd
0
140
ワイがおすすめする新潟の食 / 20250530phpconf-niigata-eve
kasacchiful
0
260
Agent Rules as Domain Parser
yodakeisuke
1
350
Investigating Multithreaded PostgreSQL
macdice
0
150
TypeScript製IaCツールのAWS CDKが様々な言語で実装できる理由 ~他言語変換の仕組み~ / cdk-language-transformation
gotok365
7
380
人には人それぞれのサービス層がある
shimabox
3
470
TypeScript を活かしてデザインシステム MCP を作る / #tskaigi_after_night
izumin5210
4
480
💎 My RubyKaigi Effect in 2025: Top Ruby Companies 🌐
yasulab
PRO
1
130
JSAI2025 RecSysChallenge2024 優勝報告
unonao
1
380
RubyKaigi Hack Space in Tokyo & 函館最速 "予習" 会 / RubyKaigi Hack Space in Tokyo & The Fastest Briefing of RubyKaigi 2026 in Hakodate
moznion
1
130
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.7k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
850
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Music & Morning Musume
bryan
47
6.6k
Building Adaptive Systems
keathley
41
2.6k
Done Done
chrislema
184
16k
Embracing the Ebb and Flow
colly
85
4.7k
How STYLIGHT went responsive
nonsquared
100
5.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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