Wednesday
Room 2
11:40 - 12:40
(UTC+02)
Talk (60 min)
Exploring Dependency Injection and Reflection in Modern C++
In the realm of modern C++ development, understanding advanced concepts like Dependency Injection (DI) and Reflection can significantly enhance code maintainability and flexibility. This talk aims to demystify these concepts and showcase what is possible through available libraries.
Dependency Injection (DI) is a design pattern fostering loosely coupled code by separating components from their dependencies. We'll delve into various DI types in C++, such as constructor, setter, interface, and template injection, exploring their use cases and best practices.
Despite C++ lacking native reflection support, we can achieve dynamic analysis and manipulation of class structures through introspection techniques like type traits, constexpr functions, and variadic templates. Template metaprogramming, complemented by features like SFINAE and type deduction, extends the capabilities for introspection and reflection.
Furthermore, we'll examine how the fusion of Dependency Injection and Reflection can facilitate extensible and adaptable software architectures. Leveraging libraries to simulate reflection and dynamically resolve dependencies enables a more flexible DI setup, easing the integration of new components into existing systems.