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.2k
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
310
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
530
better searching with elasticsearch
richardmiller
2
310
Avoiding the mud - Symfony Live London
richardmiller
7
790
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
まかせられるPM・まかせられないPM / DevTech GUILD Meetup
yusukemukoyama
0
110
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
2
260
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
3
510
CDK Deployのための ”反響定位”
watany
3
610
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
210
Running Swift without an OS
kishikawakatsumi
0
710
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
310
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
340
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
250
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
190
Coding as Prompting Since 2025
ragingwind
0
770
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
2
130
Featured
See All Featured
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
330
Visualization
eitanlees
150
17k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
53k
Navigating Team Friction
lara
192
16k
Believing is Seeing
oripsolob
1
110
Making Projects Easy
brettharned
120
6.6k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
170
Embracing the Ebb and Flow
colly
88
5k
The agentic SEO stack - context over prompts
schlessera
0
740
Paper Plane
katiecoart
PRO
1
49k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
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