Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fun main() {
val user = User("Abhishek Saxena")
val fakeUserDataSource = FakeUserDataSource()
val userRepositoryWithFakeDataSource = UserRepository(fakeUserDataSource)
userRepositoryWithFakeDataSource.save(user) // Calling save in fake data source.
val remoteUserDataSource = RemoteUserDataSource()
val userRepositoryWithRemoteDataSource = UserRepository(remoteUserDataSource)
userRepositoryWithRemoteDataSource.save(user) // Calling save in remote data source.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment