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
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
320
Avoiding the mud - Symfony Live London
richardmiller
7
790
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
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
320
AI時代になぜ書くのか
mutsumix
0
450
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
330
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
160
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
1.8k
AIエージェントの隔離技術の徹底比較
kawayu
0
420
iOS26時代の新規アプリ開発
yuukiw00w
0
200
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
1
470
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
250
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
260
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
270
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
130
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
150
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
230
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
290
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
My Coaching Mixtape
mlcsv
0
130
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
200
Docker and Python
trallard
47
3.8k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
180
Abbi's Birthday
coloredviolet
2
7.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