Today, I have friends and I mentioned the MVC pattern in Android, I am here to summarize, if there is something wrong, we heartily criticize the advice
Introduction to the MVC framework
The full name of MVC is the model View Controller, which is the abbreviation for the models-view-controller, a software design paradigm that organizes the code with a method of business logic, data, and interface display separation. Aggregating business logic into a single component does not require rewriting business logic while improving and personalizing the interface and user interaction. MVC is uniquely developed to map the traditional input, processing, and output functions in a logical graphical user interface structure.
- A model (model) represents an application core (such as a list of database records)-----------models represent data and business rules
- View (view) display data (database records)-----------views are the interfaces that users see and interact with
- Controller (Director) processes input (writes to database records)-----------controller accepts user input and invokes models and views to complete user needs
The purpose of using MVC
Separate the implementation code for M and v so that the same program can use a different representation
c The purpose of existence
Ensure that M and V are synchronized, and that once M is changed, V should be updated synchronously
Android MVC (i) Introduction to MVC