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

ViewModel 跟Repository 应该是存在一对多的关系的,另外V程跟M层没有实现解耦 #22

Open
lgengsy opened this issue Oct 16, 2019 · 0 comments

Comments

@lgengsy
Copy link

lgengsy commented Oct 16, 2019

现在demo中包括底层的架构设计都是ViewModel 跟 Repository 一一对应的关系,实际开发过程中比如说qa页面是需要判断有没有登陆的。类似这样的时候是不是就会产生一对多的关系。看了下demo项目中的代码我发现Activity层直接引用了Repository的类。比如一些常量,这样有一些轻微的依赖关系。不用databinding还导致了另外的一个问题就是 在Activity (view 层)要引用到实体类。综上m层跟v层还是存在耦合性。后续需要优化。

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