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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
290
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
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
190
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
720
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
130
CSC307 Lecture 01
javiergs
PRO
0
690
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
460
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
970
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
AI時代の認知負荷との向き合い方
optfit
0
160
CSC307 Lecture 05
javiergs
PRO
0
500
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
SourceGeneratorのススメ
htkym
0
200
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Six Lessons from altMBA
skipperchong
29
4.1k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
780
GitHub's CSS Performance
jonrohan
1032
470k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
Testing 201, or: Great Expectations
jmmastey
46
8k
Google's AI Overviews - The New Search
badams
0
910
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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