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
パフォーマンスを求めてDBに機能を寄せる戦略
aoyagikouhei
0
110
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
130
Goのエラースタックトレースの歴史と今後
sonatard
10
1.8k
GitHub Copilotのススメ
marcy731
1
230
Micro Frontends for Java Microservices - Utah JUG 2024
mraible
PRO
1
110
業務ツールとして使うPostman
msys75
0
110
PHPはいつから死んでいるかの調査
chiroruxx
2
420
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
6
1.3k
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
520
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
380
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
690
Documentation for users with AsciiDoc and Antora
ahus1
0
370
Featured
See All Featured
Building Applications with DynamoDB
mza
88
5.6k
Statistics for Hackers
jakevdp
790
220k
Adopting Sorbet at Scale
ufuk
69
8.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
649
58k
Code Reviewing Like a Champion
maltzj
515
39k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.9k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
Building Flexible Design Systems
yeseniaperezcruz
320
37k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
8
3.4k
What the flash - Photography Introduction
edds
64
11k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
9
1.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