Dependency Injection in C++ - A Practical Guide - Peter Muldoon - C++Now 2024 @CppNow
Dependency Injection in C++ - A Practical Guide - Peter Muldoon - C++Now 2024  @CppNow
Uploaded August 2024 | Updated December 2026, 2 hours ago
cppnow.org
---

Dependency Injection in C++ - A Practical Guide - Peter Muldoon - C++Now 2024
---

A key principle for testing code is the concept of Dependency Injection aka the ability to swap out functionality of key components. This feature allows not only for easier code testability but also promotes well structured code that is more extensible and flexible beyond its original use cases.

In this talk we will explore the basic building blocks that can be used for Dependency injection like link-time substitution, null-valued objects, Interfaces via Inheritance, templates, smart-pointers and polymorphic function wrappers. what are their strengths and weaknesses and the problem space they best serve.

But what exactly is good dependency injection and what are good/bad strategies for employing these building blocks ? How do you inject multiple dependencies into classes/functions without going down the road to singletons and global state ? We will also show how to introduce dependency injection into older codebases that were never designed for the concept. Doing this without having to make major changes throughout a legacy codebase ?

After exploring this and other use cases, we suggest better ways to handle these specific situations. Finally a coherent strategy for adding Dependency Injection to your applications should emerge and be added to your toolbox.
---

Slides: github.com/boostcon/cppnow_presentations_2024/blob/main/Presentations/Dependency_Injection_in_Cpp.pdf


---

Peter Muldoon

Pete Muldoon has been using C++ since 1991. Pete has worked in Ireland, England and the USA and is currently employed by Bloomberg. A consultant for over 20 years prior to joining Bloomberg, Peter has worked on a broad range of projects and code bases in a large number of companies both tech and finance. Such broad exposure has, over time, shown what works and what doesn't for large scale engineering projects. He's a proponent of applied engineering principles, elegant solutions and expressive code.
---

C++Now 2025 - 28th April - 2nd May
C++Now is an annual onsite international C++ programming and coding conference held in Aspen, Colarado. For all C++ developers, C++ software engineers and those involved with the C++ language, CppNow provides an indepth and technical content provided by the best and brightest C++ experts of the C++ world.
Annual CppNow Conference - cppnow.org
linkedin.com/company/cppnow
twitter.com/cppnow
facebook.com/CppNow
reddit.com/r/CppNow
https://mastodon.social/@cppnow
think-cell develops one of the world’s leading PowerPoint applications, with C++ at the core of everything we build, from layout algorithms to deep integration with Microsoft Office. Interested in working on challenging C++ problems with real-world impact? Explore our open roles: think-cell.com/en/career/tech
---

Videos Filmed & Edited By Bash Films: bashfilms.com
YouTube Channel Managed & Optimized By Digital Medium Ltd: events.digital-medium.co.uk
---

#boost #cpp #dependencyinjection #cppprogramming #cplusplus
Dependency Injection in C++ - A Practical Guide - Peter Muldoon - C++Now 2024C++ Magic Statics Demystified - History, Internals, Pitfalls, and Optimizations - C++Now 2026Zngur - Simplified Rust/C++ Integration - David Sankel - C++Now 2025Boost.Parser (Part 1 of 2) - A Parser Combinator Library for C++ - Zach Laine - C++Now 2024Lightning Talk: Submarines and Spies - Sherry Sontag - C++Now 2024Monadic Operations for Box-Like Types - Designing the Extensibility Model - Mikhail Svetkin - C++NowObject Oriented Programming in Contemporary C++ - Steve Downey - C++Now 2026Lightning Talk: Replace Git With JJ - Your New Version Control & DevOps Solution - Matt KulukundisC++ Reflection - Back on Track - David Olsen - C++Now 2024Lightning Talk: Printf in 1ns Using the Lightweight Logging Library - Greg Law - C++Now 2025Get A Sneak Peek Of C++Now 2024! Exclusive Interview With Michael Caisse By @cppevents!C++Now 2024 Session Preview - Interview With Katherine Rocha by @cppevents
CppNow |

Dependency Injection in C++ - A Practical Guide - Peter Muldoon - C++Now 2024

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER