当前位置:网站首页>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

边栏推荐
- Pytorch data pipeline standardized code template
- Geek challenge 2019 (review the loopholes)
- np. transpose & np.expand_ dims
- Use Arthas to locate online problems
- push to origin/master was rejected 错误解决方法
- Embedded system migration [8] - device tree and root file system migration
- 【2016】【论文笔记】差频可调谐THz技术——
- 第二部分—C语言提高篇_12. 动/精态库的封装和使用
- [step by step, even thousands of miles] key words in the specified time period of the statistical log
- 2022.7.26-----leetcode.1206
猜你喜欢

Machine learning notes - building recommendation system (3) six research directions of deep recommendation system

C language array

Dynamic SQL

Apple TV HD with the first generation Siri remote is listed as obsolete

Complete backpack and 01 Backpack

np.transpose & np.expand_dims

Part II - C language improvement_ 13. Recursive function

Real time voice quality monitoring

In simple terms, cchart daily lesson - happy high school lesson 57 new starting point, the old tree and new bud of colorful interface library

4-4 对象生命周期
随机推荐
Skiasharp's WPF self drawn bouncing ball (case version)
18. Opening and saving file dialog box usage notes
Upload files to the server
Chapter 1 requirements analysis and SSM environment preparation
Part II - C language improvement_ 11. Pretreatment
Part II - C language improvement_ 9. Linked list
会议OA之我的会议
Part II - C language improvement_ 7. Structure
18、打开、保存文件对话框使用小记
使用AW9523B芯片驱动16路LED时,LED出现误点亮的问题
What are the use cases in the Internet of things industry in 2022?
第二部分—C语言提高篇_5. 位运算
Upload files to OSS file server
np.transpose & np.expand_dims
15_ Key function and principle
MySQL transaction, phantom reading, current reading, snapshot reading related notes
嵌入式系统移植【8】——设备树和根文件系统移植
【C语言】数组
Question 152: product maximum subarray
np. transpose & np.expand_ dims