Traditional Culture Encyclopedia - Traditional stories - Besides MVC, what other website development modes are there?

Besides MVC, what other website development modes are there?

What is MVC development mode and its difference from traditional development mode?

Model 1 mode: Using pure JSP or JSP+JAVABean for development has the following defects: HTML and Java codes in JSP pages are mixed, which brings trouble to code development and reading; It is very difficult to maintain and expand the system later. For example, it is very difficult to connect and operate a database on a JSP page. If you need to modify the database, you must open all JSP pages running the database to modify it accordingly. When there are many pages, the workload is quite heavy. This system is not easy to debug. Because HTML, JAVA and JavaScript are mixed together, you must start the server and call the JSP page to see the running effect. Therefore, this model is suitable for small-scale WEB application development.

Although the development of JSP+JavaBean has realized the separation of logic function and display function, the view layer and control layer are both realized by JSP pages, that is, the view layer and control layer are not separated, so they still belong to the Model 1 mode.

Model2 mode-MVC development mode

It aims to overcome the shortcomings of 1. The specific meaning of MVC is: model+view+control, which means model+view+control. This model integrates JSP, Serclet and JavaBean, which is very suitable for the development of large-scale projects.

View view layer:

The interface that represents interaction with users can be realized by html, xml, applet java program, etc. It is only responsible for data collection and processing (display). In JSP, it is only realized through JSP pages.

Model model layer:

Often written in JavaBean, it accepts the data requested by the view layer, then carries out corresponding business processing and returns the final processing result. Its responsibility is the core, and it uses the characteristics of JavaBean to realize code reuse and expansion, which brings convenience to maintenance.

Control control layer:

The control layer receives the request from the client, then passes it to the model layer and tells the model layer what function module should be called to handle the request. It will coordinate the work between the view layer and the model layer and play the role of an intermediate hub, which is generally implemented by Serclet.

Compared with Model 1, MVC development mode has the following characteristics:

(1) Each layer has its own functions and does not interfere with each other. There is no interference to other layers after each update;

(2)MVC development mode is conducive to the division of responsibilities, allowing specialized personnel to engage in the design of specialized layers, thus improving work efficiency and quality;

(3) Components can be reused well. Because of the clear division of labor, the components of each layer can be separated into a reusable component.

However, MVC development mode is more complicated than Model 1, so it is more suitable for developing large and medium-sized project applications, while Model 1 is suitable for developing small WEB applications.