Saturday, 3 July 2021

Why does the author define a blank interface in a project?

The following code is from the project https://github.com/skydoves/Pokedex

I can't understand why the author need define a blank interface Repository.

What are the benefit using a blank interface Repository ?

Repository.kt

/** Repository is an interface for configuring base repository classes. */
interface Repository

DetailRepository.kt

class DetailRepository @Inject constructor(
  private val pokedexClient: PokedexClient,
  private val pokemonInfoDao: PokemonInfoDao
) : Repository {
   ...
}

MainRepository.kt

class MainRepository @Inject constructor(
  private val pokedexClient: PokedexClient,
  private val pokemonDao: PokemonDao
) : Repository {
   ...
}


from Why does the author define a blank interface in a project?

No comments:

Post a Comment