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
TypeScriptから始める VR生活
tamagokakeg
2
120
Three ways to use AI on Android: The Good, the Bad and the Ugly
marxallski
0
120
HonoのRPCで真の型安全が欲しかった
kosei28
1
150
Timeline エディター拡張入門
yucchiy
0
450
Namespace, What and Why
tagomoris
3
700
ソースコードを美しくたもつために ~コードレビューの認知限界を突破し、年間400リリースを達成する~
kotauchisunsun
1
770
Dev ContainersとTestcontainers
bells17
3
100
Adding Security to Microcontroller Ruby
sylph01
1
160
Long journey of Ruby standard library RubyKaigi 2024
andpad
2
230
CQRS meets modern Java
simas
PRO
2
480
Try creating your own orderedmap
kazamori
1
280
Enjoy Creative Coding with Ruby (RubyKaigi2024)
chobishiba
0
760
Featured
See All Featured
RailsConf 2023
tenderlove
9
580
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
A better future with KSS
kneath
231
16k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
22
1.4k
Rails Girls Zürich Keynote
gr2m
91
13k
Agile that works and the tools we love
rasmusluckow
325
20k
Producing Creativity
orderedlist
PRO
338
39k
Designing on Purpose - Digital PM Summit 2013
jponch
111
6.5k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
In The Pink: A Labor of Love
frogandcode
138
21k
Raft: Consensus for Rubyists
vanstee
133
6.3k
Web Components: a chance to create the future
zenorocha
306
41k
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