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

Allow other factories to get services to inject #2

Open
alexmerlin opened this issue Oct 17, 2024 · 1 comment · May be fixed by #3
Open

Allow other factories to get services to inject #2

alexmerlin opened this issue Oct 17, 2024 · 1 comment · May be fixed by #3
Assignees
Labels
enhancement New feature or request

Comments

@alexmerlin
Copy link
Member

Dotkernel API needs to create handlers using its own factory and inject dependencies (using setters) instead of getting them through the constructor.
This way handler constructors will not to be pulluted by the same key dependencies in each class.
Instead, hey can inject only those dependencies that they require for the tasks they need to perform.

Additionally, handlers have other dependencies (services, configs etc) that should be injectable through the constructor, as before.

For this, dot-dependency-injection should expose a solution that allows factories to read the dependencies as an array of ready-to-use instances.

@alexmerlin alexmerlin added the enhancement New feature or request label Oct 17, 2024
@alexmerlin alexmerlin self-assigned this Oct 17, 2024
@alexmerlin alexmerlin changed the title Allow factories to get services to inject Allow other factories to get services to inject Oct 17, 2024
alexmerlin added a commit that referenced this issue Oct 17, 2024
@alexmerlin alexmerlin linked a pull request Oct 17, 2024 that will close this issue
@alexmerlin
Copy link
Member Author

I just found out that I can solve my issue in Dotkerne API without having this feature.
Adding this feature to dot-dependency-injection is now optional - if we see value in it, we can keep it. Else, it can be discarded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant