Home Java JavaBase What are the commonly used frameworks in Java?

What are the commonly used frameworks in Java?

Nov 11, 2019 pm 03:43 PM
java Which Commonly used frame

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 of this Website
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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Perfect Number in Java Perfect Number in Java Aug 30, 2024 pm 04:28 PM

Guide to Perfect Number in Java. Here we discuss the Definition, How to check Perfect number in Java?, examples with code implementation.

Weka in Java Weka in Java Aug 30, 2024 pm 04:28 PM

Guide to Weka in Java. Here we discuss the Introduction, how to use weka java, the type of platform, and advantages with examples.

Smith Number in Java Smith Number in Java Aug 30, 2024 pm 04:28 PM

Guide to Smith Number in Java. Here we discuss the Definition, How to check smith number in Java? example with code implementation.

Java Spring Interview Questions Java Spring Interview Questions Aug 30, 2024 pm 04:29 PM

In this article, we have kept the most asked Java Spring Interview Questions with their detailed answers. So that you can crack the interview.

Break or return from Java 8 stream forEach? Break or return from Java 8 stream forEach? Feb 07, 2025 pm 12:09 PM

Java 8 introduces the Stream API, providing a powerful and expressive way to process data collections. However, a common question when using Stream is: How to break or return from a forEach operation? Traditional loops allow for early interruption or return, but Stream's forEach method does not directly support this method. This article will explain the reasons and explore alternative methods for implementing premature termination in Stream processing systems. Further reading: Java Stream API improvements Understand Stream forEach The forEach method is a terminal operation that performs one operation on each element in the Stream. Its design intention is

TimeStamp to Date in Java TimeStamp to Date in Java Aug 30, 2024 pm 04:28 PM

Guide to TimeStamp to Date in Java. Here we also discuss the introduction and how to convert timestamp to date in java along with examples.

Java Program to Find the Volume of Capsule Java Program to Find the Volume of Capsule Feb 07, 2025 am 11:37 AM

Capsules are three-dimensional geometric figures, composed of a cylinder and a hemisphere at both ends. The volume of the capsule can be calculated by adding the volume of the cylinder and the volume of the hemisphere at both ends. This tutorial will discuss how to calculate the volume of a given capsule in Java using different methods. Capsule volume formula The formula for capsule volume is as follows: Capsule volume = Cylindrical volume Volume Two hemisphere volume in, r: The radius of the hemisphere. h: The height of the cylinder (excluding the hemisphere). Example 1 enter Radius = 5 units Height = 10 units Output Volume = 1570.8 cubic units explain Calculate volume using formula: Volume = π × r2 × h (4

15 commonly used currency circle escape index technology analysis 15 commonly used currency circle escape index technology analysis Mar 03, 2025 pm 05:48 PM

In-depth analysis of the top 15 Bitcoin Escape Index: Market Outlook for 2025 This article deeply analyzes fifteen commonly used Bitcoin Escape Index, among which the Bitcoin Rhodl ratio, USDT current wealth management and altcoin seasonal index have reached the Escape Index in 2024, attracting market attention. How should investors deal with potential risks? Let us interpret these indicators one by one and explore reasonable response strategies. 1. Detailed explanation of key indicators AHR999 coin hoarding indicator: Created by ahr999, assisting Bitcoin fixed investment strategy. The current value is 1.21, which is in the wait-and-see range, so it is recommended to be cautious. Link to AHR999 Escape Top Indicator: A supplement to AHR999 Coin Hoarding Indicator, used to identify the top of the market. The current value is 2.48, this week

See all articles