'Equivalent of @componentScan in dagger?

Sorry for this basic question I am asking but can someone tell me if dagger dependency injection can work just with @module, @provides @Inject etc. That is without using @component annotation?

In spring DI, we use @componentScan to let spring know where to find beans. What is the equivalent of this in dagger?



Solution 1:[1]

You always need @Component. This is the entry point for dependencies from "outside".

When I say "outside" I mean the case where after the dependency graph inside the Component is created and now it is a time for some Activity to be Injected for example. So the component exposed dependencies for the "outside".

At the same time, a component can share its dependencies with other Subcomponents for example.

The Components depend on the Modules to know how to create dependencies.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yavor Mitev