Usually, I use an Interface for my repositories:
interface UserRepository {
fun add()
fun get(userId): User
.....
}
I have three types of Repositories (InMemory, Database, and Network):
They all implement UserRepository:
UserInMemoryRepository - UserDatabaseRepository - UserNetworkRepository
But my network doesn't have any add user API
What is the best practice here?
- Remove my UserRepository interface
- Leave an empty add user method
- ...... (Any better approach)