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

Setter Injection #197

Open
Blacksmoke16 opened this issue Sep 8, 2022 · 0 comments
Open

Setter Injection #197

Blacksmoke16 opened this issue Sep 8, 2022 · 0 comments

Comments

@Blacksmoke16
Copy link
Member

Currently the DI component only supports constructor injection. This is usually preferred/is more common, but supporting setter injection would also be nice to have. Esp when used in conjunction with modules and auto configuration. E.g. have a module of some type that when included into a service automatically registers a setter injection call on the service as well as defining the property/setter for it. This can work quite well for services that are optional versus littering the constructor with many nilable properties.

Marking this as blocked by crystal-lang/crystal#8835 just due to the complexities around resolving arguments. Being able to share/reuse that logic would make this much much easier to implement w/o making the code much much less readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant