Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

How to Use C++ Dependency Injection to Write Maintainable Software - CppCon 2022

CppCon via YouTube

Overview

Discover effective techniques for managing dependencies through dependency injection in C++ to create decoupled, easily refactored, and testable components. Learn how to handle dependencies on both data and behaviors, explore suitable situations for each approach, and discover libraries that simplify the process. Gain insights into writing components that effectively accept dependencies, propagating them throughout your codebase, and addressing complex scenarios involving multiple component dependencies and deferred instantiation. Apply these practical strategies to transform and simplify typical production code, enhancing maintainability and understanding of your software systems.

Syllabus

Intro
Dependency Injection
How to pass dependencies around
Data which is constant
Data which might change
Passing the dependencies
References are Universal
Factories
Unique Point
The Solution
Advantages and Disadvantages
Testability
Recap
Conclusion
Questions
Can it work
Passing as a parameter
Multiple functions
Piping

Taught by

CppCon

Reviews

Start your review of How to Use C++ Dependency Injection to Write Maintainable Software - CppCon 2022

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.