Analysis on model1 and model2 in Java Development

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.