MVC is an acronym for Model,view,controller, and MVC consists of three parts:
1. Model object: Is the main part of the application, and all business logic should be written on that layer.
2. View object: Is the part of the application that is responsible for generating the user interface. It is also the only layer that the user can see in the entire MVC architecture, receiving input from the user and displaying processing results.
3, controller (Control) object: is based on user input, control user interface data display and update Model object state part, controller more important a navigation function, want to use the user to start the related events, to M processing.
Android encourages weak coupling and component reuse, and MVC in Android is embodied in the following:
1, view: Generally use XML file interface description, when used can be very convenient to introduce, of course, how you learn more about Android, you can think of Android can also use javascript+ HTML and so on as the view layer, of course, there is a need for the communication between Java and JavaScript, fortunately, Android provides a very convenient communication between them implementation.
2, Control layer (Controller): The task of Android control layer usually falls on the shoulders of many acitvity, this sentence also implies do not write code in acitivity, to through activity delivery model business Logic layer processing, Another reason for this is that the response time of Acitivity in Android is 5s, and if time-consuming operations are put here, the program is easily recycled.
3, Model: the operation of the database, the operation of the network should be processed in the model, of course, business computing and other operations must be placed in the layer.
MVC is a composite pattern that may contain policy patterns, observer patterns, combinatorial patterns, singleton patterns, and so on, which are designed to understand decoupling and make programs easier to maintain and extend
MVC model in Android (composite mode)