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 of the part, controller more important a navigation function, want to use the user to start related events, to M processing.
Android encourages weak coupling and component reuse, and the detailed embodiment of MVC in Android such as the following:
1, view: Generally adopt XML file for the description of the interface, the use of the time can be very convenient to introduce, of course, how you know more about Android, you will be able to think of Android can also use javascript+ HTML and so on as the view layer, of course, there is a need for Java and JavaScript communication between, fortunately, Android provides a 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 the acitivity in Android is 5s, and the program is very easy to recycle, assuming time-consuming operations are put here.
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 include 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)