android10 / Android-CleanArchitecture

This is a sample app that is part of a series of blog posts I have written about how to architect an android application using Uncle Bob's clean architecture approach.
Apache License 2.0
15.52k stars 3.32k forks source link

Dependency with Dagger and android library #288

Open apurcaroiu opened 6 years ago

apurcaroiu commented 6 years ago

Hi,

I am working on a multi module project and I have used as a starting point this example, which helped a lot.

I am little bit stuck on this use case that I encountered:

The issue I am struggling with is that from the payment library I need to provide to the data layer API call an instance of the data store factory. Since I already have the data store factory injected as a singleton in the app module Application Component, I am not sure if I can or should expose it to the library or I need to handle a new instance managed from within the library and not use Dagger for this specific use case and repository.

Thanks for any suggestions!

rajondj commented 6 years ago

Dutch bangla bank joypurhat bangladesh. MD.ASHIKUR RAHMAN KHAN

mishkaowner commented 6 years ago

@apurcaroiu Uncle Bob clearly stated in this video, that you DONT want to inject anything into the Interactors (UseCase) period. Thank you.