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

When to avoid dependency injection #1

Open
120318 opened this issue May 29, 2019 · 0 comments
Open

When to avoid dependency injection #1

120318 opened this issue May 29, 2019 · 0 comments

Comments

@120318
Copy link

120318 commented May 29, 2019

Sometimes, when there are a lot of embedded dependencies (if your dependencies have their own dependencies), initialization can be a nightmare.

I very much agree with this, I want to know when I should inject dependencies and when I don't need them.
My current practice is that if the dependency is a toolkit or a stateless method, I would choose to use the global method directly or choose to initialize it internally.
Do you have any good suggestions?

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