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
1k
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
210
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
490
better searching with elasticsearch
richardmiller
2
260
Avoiding the mud - Symfony Live London
richardmiller
7
730
What do I get from the full stack framework?
richardmiller
1
1.3k
Dependency Injection and the Symfony2 Service Container
richardmiller
9
13k
Other Decks in Programming
See All in Programming
BuefyのMaintainerを引き継いだ件
kikuomax
0
520
Why 1 + 1 = 2 in Swift?
1plus4
1
240
OpenAPI を守るのは難しい
ohmori_yusuke
1
140
Laravel標準バリデーションでできること
hmb_ok
2
360
Some Quick Ideas To Improve Your Tests ( #jassttokyo )
teyamagu
PRO
2
2.3k
フロントエンドパフォーマンス 入門
shouta2
7
1.5k
もうすぐ新年度、Babylon.jsがお勧めな3個の理由
hideg
0
160
Enhancing Applications with Accessibility API
kishikawakatsumi
3
890
GitHub Copilot Tips and Tricks
yuichielectric
26
7.4k
C# 大統一理論推進委員会 会員のための Unity Package Manager プロジェクト構成案
monry
PRO
0
580
TDDと今まで
kanayannet
0
140
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
490
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
7
2.3k
Navigating Team Friction
lara
177
13k
What the flash - Photography Introduction
edds
64
11k
Designing the Hi-DPI Web
ddemaree
275
33k
StorybookのUI Testing Handbookを読んだ
zakiyama
10
4.5k
Bash Introduction
62gerente
604
210k
The Mythical Team-Month
searls
214
42k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
1
1.2k
Unsuck your backbone
ammeep
660
56k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
657
120k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
8
8.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
35
2.4k
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