north2016/T-MVP

为什么View中持有Model的引用?

lixplor opened this issue · 4 comments

为什么V中持有M的引用? MVP不是要切断M和V的联系, 由P来控制吗? 这样如何解耦?

public abstract class BaseActivity<T extends BasePresenter, E extends BaseModel> extends AppCompatActivity {
    public boolean isNight;
    public T mPresenter;
    public E mModel;   <---?

这里只是组装,并没有任何引用或调用的地方啊,只有P才能控制M

pexcn commented

组装?

我看到这里也有点疑问 @fantasymaker-cn

if (this instanceof BaseView) mPresenter.setVM(this, TUtil.getT(this, 1));这样明白了吗