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.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
230
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
490
better searching with elasticsearch
richardmiller
2
270
Avoiding the mud - Symfony Live London
richardmiller
7
740
What do I get from the full stack framework?
richardmiller
1
1.4k
Dependency Injection and the Symfony2 Service Container
richardmiller
9
13k
Other Decks in Programming
See All in Programming
Jakarta EE meets AI
ivargrimstad
0
260
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
500
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
840
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
550
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
940
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
2
110
php-conference-japan-2024
tasuku43
0
320
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
290
たのしいparse.y
ydah
3
120
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Being A Developer After 40
akosma
87
590k
How GitHub (no longer) Works
holman
311
140k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
It's Worth the Effort
3n
183
28k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
A designer walks into a library…
pauljervisheath
204
24k
Designing Experiences People Love
moore
138
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
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