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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
300
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
520
better searching with elasticsearch
richardmiller
2
300
Avoiding the mud - Symfony Live London
richardmiller
7
780
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
JPUG勉強会 OSSデータベースの内部構造を理解しよう
oga5
2
230
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
210
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
230
株式会社 Sun terras カンパニーデック
sunterras
0
2k
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
240
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
14
7.9k
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
290
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
370
CSC307 Lecture 15
javiergs
PRO
0
220
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
220
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
200
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1k
Featured
See All Featured
Amusing Abliteration
ianozsvald
0
120
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
99
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
380
Automating Front-end Workflow
addyosmani
1370
200k
Designing for humans not robots
tammielis
254
26k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
AI: The stuff that nobody shows you
jnunemaker
PRO
3
350
How to make the Groovebox
asonas
2
2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Un-Boring Meetings
codingconduct
0
220
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
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