When developing Java, you cannot avoid accessing model1 and model2. This blog will analyze these two architectures.
Model1:
The center of model1 is the JSP page. The JSP page integrates the business logic, server processing process, HTML, and so on, so that the business logic and process control are implemented simultaneously on the JSP page. To achieve rapid development.
Advantages and disadvantages of model1:
Advantages: simple and fast development, suitable for small-scale development
Disadvantage: the combination of business logic and presentation logic does not abstract and separate in the JSP page, and the JSP load is too large. Therefore, it is not conducive to Application System Business reuse and modification, and is not easy to maintain.
Model2:
Model 2 represents a framework based on the MVC pattern. MVC "model" represents the application's business logic (implemented through JavaBean and EJB components), and "view" is the application's representation plane (generated by JSP pages ), "controller" is to provide application processing process control (generally a servlet). Through this design model, the application logic, processing process and display logic are divided into different components for implementation. These components can be used for interaction and reuse. This makes up for the shortcomings of model1.
Model2 actually draws another layer of control layer on the basis of model1.
Advantages and disadvantages of model2:
Advantage: componentization makes it easier to develop and manage large-scale systems. Clear responsibilities.
Disadvantage: not suitable for small project development