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
280
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
770
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
モビリティSaaSにおけるデータ利活用の発展
nealle
0
570
AI駆動開発ライフサイクル(AI-DLC)のホワイトペーパーを解説
swxhariu5
0
1.3k
Doc Translate - LLMを活用したコードドキュメント自動翻訳VSCode拡張機能
eycjur
0
110
How Software Deployment tools have changed in the past 20 years
geshan
0
1.3k
JJUG CCC 2025 Fall: Virtual Thread Deep Dive
ternbusty
3
480
開発生産性が組織文化になるまでの軌跡
tonegawa07
0
190
CloudflareのSandbox SDKを試してみた
syumai
0
180
目的で駆動する、AI時代のアーキテクチャ設計 / purpose-driven-architecture
minodriven
9
3.2k
Atomics APIを知る / Understanding Atomics API
ssssota
1
180
TypeScript 5.9で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
360
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
12
7.1k
高単価案件で働くための心構え
nullnull
0
150
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
76
5.1k
Faster Mobile Websites
deanohume
310
31k
Building an army of robots
kneath
306
46k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8k
Optimizing for Happiness
mojombo
379
70k
How STYLIGHT went responsive
nonsquared
100
5.9k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.1k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
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