Auto factories / Partial construction / Assisted injection?
pshirshov opened this issue · 0 comments
pshirshov commented
Could you please give me a hint if boost.di
supports partial construction also known as assisted injection?
Let's assume that we have class T
, where some constructors parameters should be taken from the static DI context and some others are supposed to be provided dynamically. We might write a factory class, wire it with our DI framework and instantiate our T
through that factory. Although that assumes some boilerplate which can/should be avoided. Guice
lets us to automatically generate such factories in runtime, while distage
can do it during compile-time.
Is there any way to implement such approach with boost.di
?
See: