-
MVC is an acronym for Models, Views, and ControllersIt is a software design specification.
-
Organizing the code Organizing the code Organizing the code.
-
The main role of MVC is to reduce the two-story relationship between views and business logic.
-
MVC – architecture modenot design mode.
model (model): data model, provides the data to be displayed, contains data and behavior that can be regarded as a field model or a Java module (including data and behavior); But in general keep: the value object (DAO DAO) and the service layer (behavioral service). That is, the form provides functions such as querying form data and form data, including data and business layers.
view (view)A: The main screen of the form is usually the user interface that we see that customers want to see.
control (control): receive user requests, trust the model to process (change state), and return the model’s return data to the view after processing is completed, and the view is responsible for displaying the data. In other words, the controller is equivalent to the dispatcher.
Самая типичная архитектура MVC - это модель JSP+Service+Javabean
comment: -
Model (DAO and Service).
-
controller(servlet, request, response).
-
View (view data, HTML, JSP (mainly a service), etc.).
Responsibilities analysis:
Контроллер: контроллер
1. Получите данные формы
2. Позвоните в бизнес -логику
3. Поверните управление указанной страницей
Модель: модель
1. Бизнес -логика
2. Сохраните статус данных
Просмотр: Просмотр
1. Отображение страницы