After you have identified the requirements and completed the requirements, you will have to enter the development phase. Development stage, can be said to be the most important stage, the success or failure of the development phase determines the success or failure of the project. Using the right architecture during development can speed up development and improve project quality. Here are some of the most commonly used architectures in the development process. MVC
The full name of MVC is the Model View controller, which is the abbreviation for the models-view-controller, a software design specification that organizes the code with a separate approach to business logic, data, and interface display, without the need to rewrite the business logic while improving and personalizing the interface and user interaction. Models (model)
For business models, build classes related to data interactions, encapsulating the details of interactions with databases and networks. Interface (View)
Responds to user actions and displays background data. Controllers (Controller)
Responsible for the interface and background data format encapsulation, business logic processing. The advantages of a clear architecture, easy to understand and the traditional language of the MVC architecture is not a big difference, can quickly adapt to mobile application development Shortcomings MVC is not improved for mobile applications, less efficient in Android, The activity that has the controller responsibility to take into account the interface loading, appears bloated MVP
The MVP evolved from the MVC architecture, which has a certain similarity to MVC. The goal of MVP introduction is to solve the problem of too much activity in MVC. Models (model)
The interactive view that is responsible for the data
Responsible for the presentation of the data, the user's interactive display device (Presenter)
Processing view interface for business logic (view Interface)
Interfaces that require a view implementation to interact with the presenter, reduce coupling benefits , and achieve a truly complete separation of the model and view, which can modify the view without affecting the model module, clearly hiding the data at a clear level Presenter can be reused for test-driven Development view for component code flexibility disadvantage presenter in addition to the application logic, there are a lot of View->model,model->view manual synchronization logic, Cause presenter more cumbersome, maintenance will be more difficult because the view is rendered in presenter, the interaction between the views and the presenter is too frequent if presenter renders the view too much, it often makes it too close to the particular view. Once the view needs to be changed, presenter also needs to change the additional code complexity and learning cost MVVM
MVVM was improved by the MVP, the improvement of the MVP is the introduction of the data Binding, so that the original presenter work by the ViewModel layer automatic completion, no need to spend extra effort. Models (model)
Responsible for data encapsulation and interaction views (view)
Responsible for the presentation of data, interaction with the user ViewModel
For binding models and views, enabling synchronization of data changes Advantage data is automatically synchronized without adding presenter to achieve simple reduction of coupling disadvantage loss of presenter reusability, usually a model can only bind a view Lost the flexibility of presenter reference article:
Android App Design architecture: MVC,MVP,MVVM and architecture experience talk
Android MVP explanation