Broadly divided into: Field injection, construction injection, setter injection
Where Field injections are considered harmful:
1. Violation of the single principle
When there are multiple dependencies in a class, you don't see a lot of dependencies if you just use Field injection. By using the construct injection \setter injection, you can see that I usually refactor the code.
2. Rely on hidden
With the DI container, the class itself no longer manages its dependencies, but it should explicitly show dependencies through the public interface method \ constructor.
3. DI Container Coupling
Because dependencies are ambiguous, they cannot be instantiated independently of the container.
Reference documents
Https://stackoverflow.com/questions/39890849/what-exactly-is-field-injection-and-how-to-avoid-it
https://www.vojtechruzicka.com/field-dependency-injection-considered-harmful/
Common ways to compare dependency injection in Spring