search
HomeJavaJavaBaseHow to understand java architecture

How to understand java architecture

Feb 02, 2020 pm 09:00 PM
javaArchitectureunderstand

How to understand java architecture

First of all, let’s talk about the form of java development architecture:

Generally, in learning or actual development, the development architecture we know is based on two forms: C/ S architecture (client/server) and B/S architecture (browser/server). In the development of JavaEE, almost all are developed based on the B/S architecture. In the B/S architecture, the system and standard three-layer architecture include: presentation layer, business layer, and persistence layer, which are the web layer, service layer, and dao layer that we know when we first came into contact with Java Web projects.

Overview of the three-tier architecture:

1. Presentation layer:

This is the web layer we often call when we are new to web projects. It is responsible for receiving client requests and sending requests to Client response results, usually the client uses the http protocol to request the web layer, and the web layer needs to accept the http request and complete the http response. (At this layer, we mainly accept the data from the front desk and encapsulate the data for use.)

(Related video tutorial sharing: java video tutorial)

The presentation layer includes the presentation layer and the control layer: the presentation layer is responsible for displaying results, and the control layer is responsible for accepting requests. (Display and control belong to the MVC design pattern)

The presentation layer depends on the business layer. When receiving a client request, it will generally call the business layer (that is, the service layer) for business processing, and respond to the client with the processing results. .

The design of the presentation layer generally uses the MVC model (MVC is a framework pattern, which is a design pattern.)

2. Business layer:

That is We are talking about the service layer. It is responsible for the processing of business logic and is closely related to the needs of web projects. The web layer depends on the business layer, but the business layer does not depend on the web layer. (That is, we will call service in the web layer to implement specific functions. This calling relationship makes the web layer rely on the service layer.)

The business layer may rely on the persistence layer during business processing. If you want to store data Persistence requires transaction consistency. In other words, we need to control transactions at the business layer. (This layer mainly handles business logic, manages transactions, and calls the dao layer for database interaction.)

Three persistence layers:

is what we often call the dao layer. Responsible for the persistence of data, including the data layer (that is, the database) and the data access layer. The database is the carrier of data persistence. The data access layer is the interface for interaction between the business layer and the persistence layer. The business layer needs to pass the data through the data access layer. Persistence to database. In general, the persistence layer interacts with the database and performs CRUD (add, delete, modify and query) operations on the data. (This layer is mainly for database interaction, that is, adding, deleting, modifying, and querying, and persisting the resulting data to the database.)

Recommended related article tutorials: java introductory tutorial

The above is the detailed content of How to understand java architecture. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment