---
title: TYPO3 adopts Symfony’s dependency injection container in v10
url: "https://b13.com/knowledge/we-love-dependency-injection-in-typo3-v10"
description: Dependency injection in TYPO3 v10 makes code easier to maintain, test, read, and extend. Another reason to upgrade to the latest version.
image: "https://b13.com/fileadmin/_processed_/7/6/csm_dependency-injections_191-1_07a143d8fa.png"
date: 2020-06-17
modified: 2026-08-19
lastUpdated: 2026-08-19
---

# TYPO3 adopts Symfony’s dependency injection container in v10

[ TYPO3v10 ](https://b13.com/knowledge/typo3v10)

 We Love Dependency Injection in TYPO3 v10
===========================================

![](https://b13.com/fileadmin/_processed_/d/e/csm_daniel_goerz_2eed6f34a2.jpg)Daniel Goerz

  17 June 2020

 [ RSS Feed ](https://b13.com/rss.xml)

  ![A person wearing a yellow shirt labeled "INJECTOR" is pouring liquid from two bottles into a glass, surrounded by a backdrop of various bottles.](https://b13.com/fileadmin/_processed_/f/1/csm_dependency-injections_a7619f741c.webp)

Dependency injection (DI) makes code easier to maintain, test, read and extend. Until now, in TYPO3, it’s only been available in Extbase context, not in the rest of core. From TYPO3 v10, the widely adopted Symfony implementation is part of core and Extbase. It’s yet another reason to upgrade to the latest version.

   What is dependency injection?
-------------------------------

DI is a software architecture concept that avoids tightly coupling objects to their dependencies. For example, if your application needs to send email newsletters, the part that’s responsible for sending emails doesn’t need to hard-code the service used for transport. Instead, whoever instantiates the object can decide what email service to use and “inject” this dependency as a parameter. If they (or someone else) decide to use another service later on, they can inject this instead of rewriting the code.

  ![Diagram illustrating a dependency injection concept, featuring an "INJECTOR" at the top, with arrows indicating that it injects dependencies into "CLASS A" and "CLASS B," where "CLASS A" uses "CLASS B."](https://b13.com/fileadmin/_processed_/6/0/csm_DI-figure_5a4f58d879.webp)

   Separation of concerns—do one job well
----------------------------------------

This supports the separation of concerns, whereby services are dedicated to doing a single, well defined, job well while outsourcing anything else to dependencies. With applications getting larger all the time, this helps break down complex into small, bite-sized chunks.

Another advantage for devs is that dependency injection makes testing easier: a technique known as mocking enables us to pass a dummy object to simulate various scenarios. So to continue the newsletter example, you don’t have to send out emails to test what happens when emails bounce. Instead, you can simulate that behaviour by injecting a dummy object instead of the transport service. The dummy object can then return whatever success or error codes you want to test against.

As mentioned above, DI also makes it easier for devs to swap out components later on. You don’t have to rewrite code but can just pass in a different service if you need to change it.

   Symfony components flatten TYPO3’s learning curve
---------------------------------------------------

The big news around DI in TYPO3 core isn’t just DI itself, but the fact we chose to use Symfony rather than extending our existing implementation from Extbase to core. Relying on Symfony components has several advantages for TYPO3 users. It’s familiar to a wider range of coders, so it helps agencies find staff because the learning curve is flattened and the pool of suitable candidates is larger. Another boon: Symfony, including dependency injection, is already excellently documented, and documentation is central to great developer experience.

So all in all, not reinventing the wheel but using an already existing and proven solution enables the TYPO3 community and contributors to focus more on the CMS aspects of TYPO3.

   DI in production at b13
-------------------------

We were really keen for Symfony’s DI container to be available across TYPO3, so it’s unsurprising we’re already using it in production. In one project, I configured the CacheManager as a factory in my services.yaml so that the correct CacheFrontend was injected into my controller so that I did not have to get it on my own. More details about this can be found in my [blog post](https://usetypo3.com/di-and-events-example.html) about the implementation.

   What are you waiting for? Time to upgrade to v10
--------------------------------------------------

With time, more of core will be refactored to leverage dependency injection. Extensions can use it too, instead of TYPO3’s own DI they used previously. Ultimately, Symfony’s DI will replace DI in Extbase, so it’s a good idea to upgrade and write new code for v10 to save yourself rewriting it in the future.

Dependency injection is just one more example of how TYPO3 v10 is a big step in keeping our favourite CMS state of the art. Upgrade as soon as you can to get the best experience for your devs, editors, and customers so you don’t have to rewrite your code later.

   Get a quote for upgrading to TYPO3 v10
----------------------------------------

 [ Let’s connect ](https://b13.com/lets-connect)

  ###  Written by:

 ![Bild von Daniel Goerz](https://b13.com/fileadmin/_processed_/d/e/csm_daniel_goerz_9a279a5f6a.webp)

Daniel has been an integrated presence in our workday since he joined us remotely from Berlin in 2018. When not engaged in his geeky hobbies, we usually find him helping someone somewhere. His essential tool: The Internet

 Daniel Goerz  Development

 [ more from Daniel Goerz ](https://b13.com/team/daniel-goerz)

  Related Articles
------------------

- ![A yellow user interface panel featuring multiple sections and tabs, set against a dark green background with abstract shapes and gears. The panel includes placeholders for text and checkboxes.](https://b13.com/fileadmin/_processed_/9/e/csm_Dashboard_63f98a27c9.webp)

    ###  Optimize your daily workflow with the TYPO3 dashboard

     30 March 2021 | Oliver Bartsch

     The TYPO3 dashboard is geared towards maximum extensibility. Discover the benefits, take a tour under the hood and find out how to build your own custom widgets.

     [ Read more: Optimize your daily workflow with the TYPO3 dashboard ](https://b13.com/knowledge/optimize-your-daily-workflow-with-the-typo3-dashboard)
- ![Three stylized slugs with vibrant colors are depicted against a dark purple background, surrounded by abstract shapes and grass-like elements. The slugs have prominent eyes and elongated bodies, creating a whimsical underwater scene.](https://b13.com/fileadmin/_processed_/e/6/csm_slugs_17a8ee1543.webp)

    ###  Auto-updated redirects: A feature to convince you to upgrade TYPO3

     08 December 2020

     TYPO3 made some important updates to site handling in v9 and v10. We wrote an explainer on new changes, including slug naming and automatic redirects.

     [ Read more: Auto-updated redirects: A feature to convince you to upgrade TYPO3 ](https://b13.com/knowledge/auto-slug-update-typo3-v10)
- ![A person wearing a beret and a fringed poncho waves goodbye to a steam train, surrounded by stylized smoke and a dark background.](https://b13.com/fileadmin/_processed_/3/c/csm_Deprecations_f2863dfb8d.webp)

    ###  Deprecations and breaking changes to celebrate in TYPO3 v10

     18 August 2020 | Michael Semle

     These changes keep TYPO3 awesome. They’re worth the effort it takes to adapt!

     [ Read more: Deprecations and breaking changes to celebrate in TYPO3 v10 ](https://b13.com/knowledge/deprecations-and-breaking-changes-to-celebrate-in-typo3-v10)
- ![A person holds two large signs displaying the word "EVENT" in bold letters. The figure is stylized with a simplified design and a warm color palette, set against a vibrant background.](https://b13.com/fileadmin/_processed_/6/4/csm_event-dispatcher_22da41c4ee.webp)

    ###  Another thing we love about TYPO3 v10: the PSR-14 event dispatcher

     11 August 2020 | Daniel Goerz

     It’s easier to extend third-party TYPO3 code, both for new and seasoned developers. Another reason to upgrade.

     [ Read more: Another thing we love about TYPO3 v10: the PSR-14 event dispatcher ](https://b13.com/knowledge/psr-14-event-dispatcher-in-typo3-v10)
- ![A stylized flamingo floats in a pool with a drink in its wing, surrounded by abstract shapes and tropical leaves. The color scheme features deep purples and soft pastels.](https://b13.com/fileadmin/_processed_/9/e/csm_Lazy_Images_faf015e156.webp)

    ###  Lazy loading just got lazier in TYPO3 v10

     28 July 2020 | Daniel Sattler

     Learn how TYPO3 v10 supports reduced page load times and saves bandwidth with browser-native image lazy loading. No JS required!

     [ Read more: Lazy loading just got lazier in TYPO3 v10 ](https://b13.com/knowledge/lazy-loading-just-got-lazier-in-typo3-v10)
- ![A person stands with a questioning expression next to a locked padlock and a password input field, surrounded by stylized keys and abstract shapes, symbolizing security and access challenges.](https://b13.com/fileadmin/_processed_/8/9/csm_Forgot_Password_bcd4ae8edd.webp)

    ###  More Secure, Convenient, and Efficient Password Reset

     01 July 2020 | Daniel Gorges

     Editors can reset their password securely without having to contact an admin. Another reason to upgrade to the latest version.

     [ Read more: More Secure, Convenient, and Efficient Password Reset ](https://b13.com/knowledge/more-secure-convenient-and-efficient-password-reset)
- ![An open envelope with an orange letter emerging from it, surrounded by various email icons and abstract shapes in a dark background.](https://b13.com/fileadmin/_processed_/f/3/csm_Emails_28e5a2c0d7.webp)

    ###  HTML Emails and Multiple Recipients in Core

     25 June 2020 | Michael Semle

     HTML emails look great, are more readable, and conform to your brand identity. Another reason to upgrade to TYPO3 v10.

     [ Read more: HTML Emails and Multiple Recipients in Core ](https://b13.com/knowledge/html-emails-in-typo3-v10)
- ![Two pairs of stylized figures stand side by side against a colorful abstract background. The left pair features a man and woman with curly hair, while the right pair includes another man and woman, both with different hairstyles.](https://b13.com/fileadmin/_processed_/0/d/csm_Comparing_User_Groups_8abbafea8e.webp)

    ###  New in TYPO3 v10: Comparing backend user groups

     09 June 2020 | Desirée Lochner

     Get a grip on your backend user groups by comparing them side-by-side. Another great reason to upgrade to TYPO3 v10!

     [ Read more: New in TYPO3 v10: Comparing backend user groups ](https://b13.com/knowledge/comparing-backend-user-groups-in-typo3)
- ![A person sits at a table with their feet up, using a laptop. Floating chat bubbles and a graphic of a landscape are visible in the background, suggesting online communication and digital content creation.](https://b13.com/fileadmin/_processed_/1/7/csm_Create_Content_Elements_0904390bfe.webp)

    ###  Add non-configurable content elements with one click in TYPO3 v10

     03 June 2020 | David Steeb

     TYPO3 v10 saves editors time and clicks: no need to save then close for content elements with no configuration settings. Another reason to upgrade!

     [ Read more: Add non-configurable content elements with one click in TYPO3 v10 ](https://b13.com/knowledge/one-click-adding-of-content-elements-in-typo3)
- ![The number "13" is prominently displayed in a stylized font, accompanied by abstract shapes, circles, and coding symbols in a green and orange color scheme.](https://b13.com/fileadmin/_processed_/9/b/csm_13-Things_215bb3d4bc.webp)

    ###  13 Little Things We Love in TYPO3 v10

     22 April 2020 | Benni Mack

     13 of our favorite small but useful improvements in TYPO3 CMS version 10 that each make our working lives a tiny bit better.

     [ Read more: 13 Little Things We Love in TYPO3 v10 ](https://b13.com/knowledge/13-little-things-we-love-about-typo3-v10)