当前位置:网站首页>4-4 object lifecycle
4-4 object lifecycle
2022-07-27 00:07:00 【Sleepy sheep】
explain : In this section ioc Which stage of the container bean What did you do

Illustrate with a case

Create order attributes


go back to xml To configure

Do you want to calculate the price manually ? Where are we going to let the program calculate ?

It's right to do so, but every call requires an operation
increase init Method


Take advantage of init-method It is the feature of executing after setting properties total Calculation of properties
In order to make the program run more clearly , We print some text at every step of object creation and property setting



![]()
![]()
function

Release resources when destroying , How do you do that ?
![]()
Added for destruction ioc Container method , This method does not exist in applicationContext This interface is defined in... Instead classPathXmlapplicationContext In this concrete implementation class , Therefore, when calling a method, it is determined by idea Automatically convert back to the specific implementation class for us
The process of destroying the container will automatically call us in bean Set in the
Method

What does resource mean ? In fact, during the process of program operation, these resources , It can be a file , It can also be a network connection , It can even be called by other systems , These are called resources , And in the destory We will release these resources ,
Run it

边栏推荐
- Transformers is a graph neural network
- MVC三层架构
- NFT display guide: how to display your NFT collection
- 2022.7.26-----leetcode.1206
- 力扣152题:乘积最大子数组
- JUnit、JMockit、Mockito、PowerMockito
- 第二部分—C语言提高篇_13. 递归函数
- Part II - C language improvement_ 6. Multidimensional array
- Bid farewell to wide tables and achieve a new generation of Bi with DQL
- Share a regular expression
猜你喜欢

第1章 开发第一个restful应用

Part II - C language improvement_ 9. Linked list

Chapter 1 requirements analysis and SSM environment preparation
![[Gorm] model relationship -hasone](/img/90/3069059ddd09dc538c10f76d659b08.png)
[Gorm] model relationship -hasone

华测RTK采集的GPX数据如何带属性转出kml、shp进行后续的管理和分析

关于可穿戴式NFT你应该知道的一切!

NFT display guide: how to display your NFT collection

C语言数组

The place where the dream begins ---- first knowing C language (2)

push to origin/master was rejected 错误解决方法
随机推荐
15_ Key function and principle
2022.7.26-----leetcode.1206
13_ conditional rendering
使用AW9523B芯片驱动16路LED时,LED出现误点亮的问题
The difference between SQL join and related subinquiry
Practice of intelligent code reconstruction of Zhongyuan bank
08_ Event modifier
第1章 需求分析与ssm环境准备
Number that cannot be bought
[step by step, even thousands of miles] key words in the specified time period of the statistical log
Oracle remote connection configuration
Go uses flag package to parse command line parameters
Part II - C language improvement_ 8. File operation
Skiasharp's WPF self drawn bouncing ball (case version)
【C语言】数组
[netding Cup 2018] Fakebook records
What are the use cases in the Internet of things industry in 2022?
力扣152题:乘积最大子数组
Force deduction 155 questions, minimum stack
Azure Synapse Analytics 性能优化指南(3)——使用具体化视图优化性能(下)