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
Cloudflare Workersの環境を再現することについて
yusukebe
5
730
decksh - a little language for decks
ajstarks
4
18k
人口ダッシュボード作成講座資料
jo76shin
0
170
Learning PHP and Static Analysis with PHP Parser
inouehi
1
220
ADRを一年運用してみた/our_story_about_adr
hanhan1978
3
1.1k
開発者体験を変えるInfrastructure as Codeの新機能6選!
konokenj
4
850
ログラスの継続的なプロンプト改善のためのLLMOpsの今 / LLMOps at loglass now
rkaga
PRO
1
330
Faster, greener, and happier- why Quarkus should be your next tech stack
hollycummins
0
130
「Hono遍歴」と「HonoXでブログ作成」
yasu551
0
170
TokyoR#111_ANOVA
kilometer
1
710
ファイル先頭の use の意味、説明できますか? 〜PHP の namespace と autoloading の関係を正しく理解しよう〜 / namespace and autoloading in php
okashoi
2
410
Не учите алгоритмы
hellsquirrel
1
700
Featured
See All Featured
Become a Pro
speakerdeck
PRO
8
4.2k
Building Your Own Lightsaber
phodgson
97
5.6k
How GitHub (no longer) Works
holman
301
140k
A better future with KSS
kneath
230
16k
Fireside Chat
paigeccino
19
2.5k
Fontdeck: Realign not Redesign
paulrobertlloyd
75
4.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
Raft: Consensus for Rubyists
vanstee
130
6.2k
Large-scale JavaScript Application Architecture
addyosmani
501
110k
Designing Experiences People Love
moore
135
23k
The Art of Programming - Codeland 2020
erikaheidi
40
12k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
185
15k
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