[英]Where should i put downloader classes in MVVM?
I've written a download manager app for Android. 我已经为Android编写了一个下载管理器应用程序。 Now i want to refactor it's structure to MVVM.
现在我想将其结构重构为MVVM。 but i have some questions.
但是我有一些问题。
Into what layer I should move downloader
classes such as DownloadManager.java
(which manages download queue, etc), Downloader.java
(which creates an empty file then downloads data and write into that empty file), etc? 我应该将诸如
DownloadManager.java
(管理下载队列等), Downloader.java
(创建一个空文件然后下载数据并写入该空文件)之类的downloader
类移到哪一层?
into what layer i should move Application
class which is responsible for creating database for the first time? 我应该将负责首次创建数据库的
Application
类移到哪一层?
thanks. 谢谢。
Let's say you have 3 layers, 假设您有3层,
Downloader.java should be in the Data layer Downloader.java应该在数据层中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.