【问题标题】:Repository pattern with paging library带有分页库的存储库模式
【发布时间】:2018-09-22 06:37:24
【问题描述】:

将Paging Library 应用到我正在使用 (Repository Pattern) 的项目时遇到问题

在我的存储库中,我已经有UsersDataSource、UsersRepository、UserLocalDataSource、UserRemoteDataSource

要使用Paging Library,我知道我们需要创建像...DataSource extend ItemKeyedDataSource和...DataSourceFactory extend DataSource.Factory这样的类(我按照教程here学习Paging library)。
它与我当前的存储库类冲突。

有什么好的方法可以将Paging Library 与Repository 模式一起应用。
我只是学习分页库。任何帮助或建议将不胜感激。

【问题讨论】:

  • 您找到解决方案了吗?我正在努力使用 Paging + RxJava + Repository 模式。

标签: android android-paging-library


【解决方案1】:

Android 开发者页面上有一条关于如何完成这种架构的建议: https://developer.android.com/topic/libraries/architecture/paging/#network-with-database-data-arch 你可以在那里找到合适的 github repo 甚至是 codelab 的链接。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-02
    • 2020-11-03
    • 2023-03-21
    • 2021-11-15
    • 1970-01-01
    • 1970-01-01
    • 2011-03-09
    • 1970-01-01
    相关资源
    最近更新 更多