Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to parse the Java Spring framework

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces you how to analyze the Java Spring framework, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Overview of Spring Framework

Spring is a lightweight open source JAVAEE framework

Spring can solve the complexity of enterprise application development.

Spring has two core parts: IOC and Aop

IOC: control reversal, handing over the process of creating objects to Spring for management

Aop: aspect-oriented, without modifying the source code for functional enhancement

Characteristics of Spring

Facilitate decoupling and simplify development

Aop programming support

Convenient program testing

Facilitate integration with other frameworks

Facilitate transaction operations

Reduce the difficulty of using API

IOC container

Basic principle of IOC

IOC Interface (BeanFactory)

IOC Operations Bean Management (based on XML)

IOC Operations Bean Management (based on annotations)

The concept and principle of IOC what is IOC

Reverse control, transfer the object creation and the procedure between objects to Spring for management

The purpose of using IOC: to reduce the degree of coupling

Basic principle of IOC

Xml parsing, factory mode, reflection

IOC interface

The IOC idea is based on the IOC container, and the bottom layer of the IOC container is the object factory.

Spring provides IOC container implementation in two ways: (two interfaces)

A subinterface of the BeanFactory interface, which provides more and more powerful features, and is generally used by developers

The profile object is created when the configuration file is loaded

The basic implementation of the IOC container is the internal use of spring interfaces, which are not available for developers to use.

Loading a configuration file does not create an object, but does not create an object until it is acquired

BeanFactory:

ApplicationContext:

Use ApplicationContext to leave the loading process to the startup server, not to the running server.

The ApplicationContext interface has an implementation class

Disk path classpath

IOC Operations Bean Management

What is Bean Management

Spring create object

Spring injection Properties

There are two ways to manage Bean operations

Implementation based on xml configuration file

Implementation based on annotations

IOC Operation Bean Management (xml) creates a formation based on xml

In the Spring configuration file, you can create objects by using bean tags and adding corresponding attributes to the tags.

There are many attributes in the bean tag, commonly used attributes:

Id attribute: unique identification

Class attribute: class full path

When you create an object, the default is to perform no-parameter construction

Attribute injection based on xml

DI: dependency injection, injection attributes

Use set method to inject

Attribute: class full path

When you create an object, the default is to perform no-parameter construction

On how to analyze the Java Spring framework to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report