Our great sponsors
-
lager
C++ library for value-oriented design using the unidirectional data-flow architecture — Redux for C++
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Hey, I'm making a "bigger" application and I am using Dependency Inversion to separate different layers of my application. I was looking into Dependency Injection frameworks for c++ to simplify this process. I found google fruit (https://github.com/google/fruit) which looks decent, but I dont have much experience with this DI (in c++). Did anyone work with something similar and could give me advice on this topic or recommend me another library for this?
My preferred approach is to abstract things so the boundary between the objects is not a function call, but a value being passed. This was shown to me the first time via Boundaries (from Gary Bernhadt). In C++ world, the talks from Juan Pedro Bolívar Puente are great, as he also is the author of a framework to structure applications that way, the framework is open source, and it's been used in production applications, probably using Qt as well. I would start by watching The Most Valuable Values and Squaring the Circle. If you prefer text, go read Lager's excellent documentation.
This Fruit library is still on my TO-DO to review and try, but there is one other library that I wanted to try first, and it's called Kangaru. Both are DI injectors, but I can't say much more about them yet.
I was looking to try boost.di for some time, looks nice. https://boost-ext.github.io/di/