摘要
传统的MVC模式在Android的应用开发中存在诸多不足,主要表现在Android应用开发的关键类Activity会充当Controller和View的合体,既要负责业务逻辑,又要负责显示,造成Activity的职责过多,耦合度高。MVP模式是MVC模式演进而来,引入了Presenter彻底分离Model和View层,在解决Activity臃肿的问题同时,还有助于后期的测试与维护。本文分析MVC对于Android开发的不足,并探索MVP模式在Android开发中的可行性,以及优劣势,最后实现MVP模式在Android开发中的应用。
Traditional MVC pattern had many deficiencies in application development of Android. The key class Activity acted as the Controller and the View, it would be responsible for business logic, while also be responsible for UI. The Activity would be a higher degree of coupling and heavy duty. The MVP pattern was evolved from MVC, the Presenter of MVP separated the Model and the View for solving the problem of a big Activity, and to be beneficial to code-test and software maintenance. The paper analyzed insufficient of MVC in Android, and explored the feasibility, the advantages and the disadvantages of MVP pattern. Finally implemented Android Application Development based on MVP pattern.
出处
《软件》
2016年第6期75-78,共4页
Software