Dependency Injection and Dependency Inversion: C++ Perspective
Vladimir Vishnevskii
std::cout
Dependency Injection (DI) is a well-established design principle, yet in C++ it is often perceived as tightly coupled with runtime polymorphism and complex abstractions. This talk revisits dependency injection from first principles, focusing on what DI and Dependency Inversion really mean in the context of C++ and why they remain relevant across all project sizes. Rather than approaching DI as a standalone pattern, the presentation shows how dependency injection is supported by core C++ language facilities and modern design practices. It will examine how modern C++ features influence the way dependencies are expressed, wired, and constrained without defaulting to heavyweight frameworks or mandatory runtime polymorphism. The session also covers how different dependency injection approaches translate into generated code and what impact they have on performance characteristics. By comparing various options, the presentation provides insight into the trade-offs between flexibility, abstraction cost, and runtime efficiency, helping developers make informed design decisions and retain control over performance. This session is intended for developers who are new to C++, as well as for mid-level C++ developers who want to better understand how modern C++ language features and design principles work together to support effective Dependency Injection and Dependency Inversion.
Vladimir Vishnevskii
Vladimir is a software engineer who has used C++ for the development of system software for more than 20 years. His focus is on performant distributed, concurrent, and low-level solutions without compromising quality. When he encounters an interesting topic, he actively shares it with the community through conferences and meetups.