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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Richard Miller
June 11, 2012
Programming
1.3k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
330
Avoiding the mud
richardmiller
22
12k
better searching with elasticsearch - PHPConfPL
richardmiller
2
550
better searching with elasticsearch
richardmiller
2
330
Avoiding the mud - Symfony Live London
richardmiller
7
810
What do I get from the full stack framework?
richardmiller
1
1.7k
Dependency Injection and the Symfony2 Service Container
richardmiller
9
13k
Other Decks in Programming
See All in Programming
ソフトウェアラスタライザ
fadis
1
780
高専キャリア LT 発表内容
crysta1221
6
5.4k
FDEとは、何者なのか?
masapyon1212
0
120
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
620
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
53
34k
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
530
AIエージェント時代のコードレビューを設計する
nogu66
5
2.4k
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
410
リアルな遅延を測る仕様
kota_yata
1
140
「つくるAI」だけではバグは見つからない ~テストに必要な「見つけるAI」を分離させる戦略~
mfunaki
0
230
XHTMLが残したもの
yosuke_furukawa
PRO
1
380
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
140
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
230
The SEO Collaboration Effect
kristinabergwall1
1
550
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
590
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Ruling the World: When Life Gets Gamed
codingconduct
0
320
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
A better future with KSS
kneath
240
18k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
510
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
230
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