search
HomeJavaJavaBaseWhat are the commonly used frameworks in Java?
What are the commonly used frameworks in Java?Nov 11, 2019 pm 03:43 PM
javaWhichCommonly usedframe

What are the commonly used frameworks in Java?

1. SpringMVC

Spring Web MVC is a lightweight request-driven type based on Java that implements the Web MVC design pattern. The Web framework uses the idea of ​​​​the MVC architectural pattern to decouple the responsibilities of the web layer. Request-driven means using the request-response model. The purpose of the framework is to help us simplify development. Spring Web MVC also wants to simplify our daily Web developing.

The model encapsulates the application data and the POJOs they generally form.

The view (View) is responsible for presenting model data and generally the HTML output it generates, which the client's browser can interpret.

The controller (Controller) is responsible for processing the user's request, establishing the appropriate model, and passing it to the view for rendering.

Spring Web MVC request processing process:

What are the commonly used frameworks in Java?

2, Spring

IOC container

The IOC container is a container with dependency injection function. The IOC container is responsible for instantiating, locating, configuring objects in the application and establishing dependencies between these objects. The application does not need to directly new related objects in the code, the application is assembled by the IOC container. In Spring, BeanFactory is the actual representative of the IOC container.

AOP

Simply put, it is to encapsulate logic or responsibilities that have nothing to do with the business but are commonly called by business modules to reduce duplicate code in the system. , reduce the coupling between modules and facilitate future operability and maintainability. AOP represents a horizontal relationship.

3. Mybatis

MyBatis is an excellent persistence layer framework that supports ordinary SQL queries, stored procedures and advanced mapping. MyBatis eliminates almost all JDBC code and manual setting of parameters and retrieval of result sets. MyBatis uses simple XML or annotations for configuration and original mapping, mapping interfaces and Java POJOs (Plain Old Java Objects, ordinary Java objects) into records in the database.

Overall process:

(1), load configuration and initialize

Trigger condition: load configuration file

Load SQL configuration information into MappedStatement objects (including incoming parameter mapping configuration, executed SQL statements, and result mapping configuration) and store them in memory.

(2), receive the call request

Trigger condition: call the API provided by Mybatis

Incoming parameters: SQL ID and incoming Parameter object

Processing process: Pass the request to the lower request processing layer for processing.

(3), Process the operation request

Trigger condition: API interface layer passes the request

Incoming parameters: SQL ID and Enter the parameter object

Processing process:

(A) Find the corresponding MappedStatement object according to the SQL ID.

(B) Parse the MappedStatement object according to the incoming parameter object to obtain the final SQL to be executed and the execution incoming parameters.

(C) Obtain the database connection, pass in the final SQL statement and execution parameters to the database for execution, and obtain the execution result.

(D) Convert the execution result obtained according to the result mapping configuration in the MappedStatement object, and obtain the final processing result.

(E) Release connection resources.

(4). Return the processing result and return the final processing result

One of the most powerful features of MyBatis is its dynamic statement function. If you have experience using JDBC or similar frameworks before, you will know how painful it is to chain SQL statement conditions together, making sure not to forget spaces or not to omit a comma after columns, etc. Dynamic statements can completely solve these pains.

Recommended tutorial: java tutorial

The above is the detailed content of What are the commonly used frameworks in Java?. 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
带你搞懂Java结构化数据处理开源库SPL带你搞懂Java结构化数据处理开源库SPLMay 24, 2022 pm 01:34 PM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于结构化数据处理开源库SPL的相关问题,下面就一起来看一下java下理想的结构化数据处理类库,希望对大家有帮助。

Java集合框架之PriorityQueue优先级队列Java集合框架之PriorityQueue优先级队列Jun 09, 2022 am 11:47 AM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于PriorityQueue优先级队列的相关知识,Java集合框架中提供了PriorityQueue和PriorityBlockingQueue两种类型的优先级队列,PriorityQueue是线程不安全的,PriorityBlockingQueue是线程安全的,下面一起来看一下,希望对大家有帮助。

完全掌握Java锁(图文解析)完全掌握Java锁(图文解析)Jun 14, 2022 am 11:47 AM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于java锁的相关问题,包括了独占锁、悲观锁、乐观锁、共享锁等等内容,下面一起来看一下,希望对大家有帮助。

一起聊聊Java多线程之线程安全问题一起聊聊Java多线程之线程安全问题Apr 21, 2022 pm 06:17 PM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于多线程的相关问题,包括了线程安装、线程加锁与线程不安全的原因、线程安全的标准类等等内容,希望对大家有帮助。

Java基础归纳之枚举Java基础归纳之枚举May 26, 2022 am 11:50 AM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于枚举的相关问题,包括了枚举的基本操作、集合类对枚举的支持等等内容,下面一起来看一下,希望对大家有帮助。

详细解析Java的this和super关键字详细解析Java的this和super关键字Apr 30, 2022 am 09:00 AM

本篇文章给大家带来了关于Java的相关知识,其中主要介绍了关于关键字中this和super的相关问题,以及他们的一些区别,下面一起来看一下,希望对大家有帮助。

java中封装是什么java中封装是什么May 16, 2019 pm 06:08 PM

封装是一种信息隐藏技术,是指一种将抽象性函式接口的实现细节部分包装、隐藏起来的方法;封装可以被认为是一个保护屏障,防止指定类的代码和数据被外部类定义的代码随机访问。封装可以通过关键字private,protected和public实现。

Java数据结构之AVL树详解Java数据结构之AVL树详解Jun 01, 2022 am 11:39 AM

本篇文章给大家带来了关于java的相关知识,其中主要介绍了关于平衡二叉树(AVL树)的相关知识,AVL树本质上是带了平衡功能的二叉查找树,下面一起来看一下,希望对大家有帮助。

See all articles

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 Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!