4 ms·
> First: constructor calling is not readable because Java misses named parameters. It's fine when there are 2-3 dependencies, but not more. If you have more th
by kilink 11y ago
> First: constructor calling is not readable because Java misses named parameters. It's fine when there are 2-3 dependencies, but not more.
If you have more than 2-3 dependencies, it might be time to refactor things, as your class may be doing too many things.
> Second: circular dependency is not possible.
Circular dependencies are possible with constructor injection when using a DI framework (e.g., using a Provider in Guice [1], or the equivalent in Dagger).
[1] https://github.com/google/guice/wiki/CyclicDependencies https://github.com/google/guice/wiki/CyclicDependencies