Skip to content

Dependency with Dagger and android library #288

Open
@apurcaroiu

Description

@apurcaroiu

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:

  • Based on this clean architecture example, let's say I need another library android module which will handle payments with google play.
    It provides the entire billing provider integration and I decided to build it as a library as it will be referenced from other modules as well.
  • Once a purchase is being made I would need to update my wallet amount remote which is part of the data layer currently. So my payment library will have a reference to it.

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions