Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议移除 repository 层 #7

Open
yujinyan opened this issue Dec 30, 2020 · 0 comments
Open

建议移除 repository 层 #7

yujinyan opened this issue Dec 30, 2020 · 0 comments

Comments

@yujinyan
Copy link
Contributor

yujinyan commented Dec 30, 2020

注意到项目中的 ShoeRepository 几乎都是直接调用 dao,没有提供其他有用的价值,不如直接在 view model 使用 dao 更加方便维护。

有些 Repository 方法 withContext 做了线程切换操作,这个在 repository 做是合理的,但是 Room 原生也已经支持 suspend 方法了。

有篇相关的文章:
https://proandroiddev.com/anemic-repositories-mvi-and-rxjava-induced-design-damage-and-how-aac-viewmodel-is-silently-1762caa70e13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant