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
290
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
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
190
コードとあなたと私の距離 / The Distance Between Code, You, and I
hiro_y
0
190
オープンソースソフトウェアへの解像度🔬
utam0k
17
3.1k
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
630
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
600
CSC305 Lecture 09
javiergs
PRO
0
300
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
11
7k
理論と実務のギャップを超える
eycjur
0
170
Devoxx BE 2025 Loom lab
josepaumard
0
110
チームの境界をブチ抜いていけ
tokai235
0
210
Claude Agent SDK を使ってみよう
hyshu
0
1.3k
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
110
Featured
See All Featured
Music & Morning Musume
bryan
46
6.9k
RailsConf 2023
tenderlove
30
1.3k
Git: the NoSQL Database
bkeepers
PRO
431
66k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
Docker and Python
trallard
46
3.6k
For a Future-Friendly Web
brad_frost
180
10k
Side Projects
sachag
455
43k
Scaling GitHub
holman
463
140k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Being A Developer After 40
akosma
91
590k
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