If I have a very large component, can I tell Dagger to only load it when needed at program start?

Viewed 19

I am using Dagger for DI in my java program, I will be using AWS lambda to host the service.

There is one component that takes a long time to load, and multiple services will be hosted but not all service will require this component. So the problem is this large component will be loaded whether or not required.(extra cost in Lambda)

Is there a way such I can let dagger know not to load this costly component every time, or any way to let dagger only load necessary components?

I am very new to Dagger, I do not know what keywords to use to search this question. If this question is already answered elsewhere, a paste of the link will be appreciated.

Thanks ahead!

0 Answers
Related