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.2k
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
310
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
530
better searching with elasticsearch
richardmiller
2
310
Avoiding the mud - Symfony Live London
richardmiller
7
790
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
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
120
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
メッセージングを利用して時間的結合を分離しよう #phperkaigi
kajitack
3
560
Radical Imagining - LIFT 2025-2027 Policy Agenda
lift1998
0
250
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
320
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
180
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
130
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
2
260
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
230
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
210
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
130
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
970
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.2k
Google's AI Overviews - The New Search
badams
0
960
GitHub's CSS Performance
jonrohan
1032
470k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
4 Signs Your Business is Dying
shpigford
187
22k
Building Adaptive Systems
keathley
44
3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
A Modern Web Designer's Workflow
chriscoyier
698
190k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.3k
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