Last active
November 27, 2019 19:18
-
-
Save Zhuinden/65ef616a184d7a6e98424d6755d7d119 to your computer and use it in GitHub Desktop.
Anemic Repository 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is an anti-pattern (technically code smell) | |
class UserRepository( | |
private val userDao: UserDao | |
) { | |
fun getAllUsersWithChanges(): LiveData<List<User>> = | |
userDao.getAllUserWithChanges() | |
fun getAllUsers(): List<User> = | |
userDao.getAllUsers() | |
fun getUserByIdWithChanges(userId: String): LiveData<User> = | |
userDao.getUserWithChanges(userId) | |
fun deleteUserById(userId: String) { | |
userDao.deleteUserById(userId) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment