Java Web: Layered design

Source: Internet
Author: User

1, the early web system is not designed using layered thinking, a lot of code will appear in a servlet or JSP, which inevitably lead to poor code quality.

2. Mvc layering mode

The MVC layering pattern refers to the abbreviation of model, view, control (Controller), and the use of layered mode can not only improve the quality of the code, but also have great benefit to the later maintenance.

The MVC layering pattern is mainly used to realize the functional division of the web system.

In the MVC design structure:

The model layer mainly implements the business logic in the system, which can usually be implemented by JavaBean or EJB;

View layer is mainly used to interact with the user, mainly using JSP implementation;

The Cotroller layer is a bridge between the model layer and the view layer, which is usually implemented using a servlet;

3. What is a three-tier architecture?

The usual three-tier architecture refers to dividing the entire business application into three tiers: the presentation layer (UI), the Business Logic layer (BLL), the data Access layer (DAL);

The purpose of three-layer architecture: cohesion, low coupling;

Presentation Layer (UI): Popular speaking, is what the user can see on the page;

Business Logic Layer (BLL): According to the operation of the specific problem, the data is processed by business and logic;

Data access Layer (DAL): Also known as the persistent layer, is to access the database, to achieve additions and deletions to change the data operation.

Java Web: Layered design

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.