Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto factories / Partial construction / Assisted injection? #563

Open
pshirshov opened this issue Jun 25, 2024 · 0 comments
Open

Auto factories / Partial construction / Assisted injection? #563

pshirshov opened this issue Jun 25, 2024 · 0 comments

Comments

@pshirshov
Copy link

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:

  1. https://izumi.7mind.io/distage/basics.html#auto-factories
  2. https://github.com/google/guice/wiki/AssistedInject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant