Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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.2k
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
290
Avoiding the mud
richardmiller
22
11k
better searching with elasticsearch - PHPConfPL
richardmiller
2
520
better searching with elasticsearch
richardmiller
2
290
Avoiding the mud - Symfony Live London
richardmiller
7
770
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
Basic Architectures
denyspoltorak
0
120
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
140
これならできる!個人開発のすゝめ
tinykitten
PRO
0
130
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
130
Graviton と Nitro と私
maroon1st
0
140
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
0
190
GoLab2025 Recap
kuro_kurorrr
0
780
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
460
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
4
1.3k
チームをチームにするEM
hitode909
0
390
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.4k
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
4k
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
95
14k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
58
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
210
Practical Orchestrator
shlominoach
190
11k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Prompt Engineering for Job Search
mfonobong
0
130
Optimizing for Happiness
mojombo
379
70k
Documentation Writing (for coders)
carmenintech
77
5.2k
Why Our Code Smells
bkeepers
PRO
340
57k
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