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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
330
Avoiding the mud - Symfony Live London
richardmiller
7
800
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
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
280
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
150
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
250
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
520
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.9k
Modding RubyKaigi for Myself
yui_knk
0
910
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
160
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
210
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
190
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
スマートグラスで並列バイブコーディング
hyshu
0
120
dRuby over BLE
makicamel
2
330
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
470
The Curse of the Amulet
leimatthew05
1
13k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Are puppies a ranking factor?
jonoalderson
1
3.5k
Un-Boring Meetings
codingconduct
0
310
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
840
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
960
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
530
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Chasing Engaging Ingredients in Design
codingconduct
0
220
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